Subversion Repositories DevTools

Rev

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

Rev 2478 Rev 2764
Line 50... Line 50...
50
my $opt_help = 0;
50
my $opt_help = 0;
51
my $opt_manual = 0;
51
my $opt_manual = 0;
52
my $opt_verbose = 0;
52
my $opt_verbose = 0;
53
my $opt_repo_base = 'AUPERASVN01/';
53
my $opt_repo_base = 'AUPERASVN01/';
54
my $opt_repo = '';
54
my $opt_repo = '';
-
 
55
my $opt_repoSubdir = '';
55
my $opt_flat;
56
my $opt_flat;
56
my $opt_test;
57
my $opt_test;
57
my $opt_reuse;
58
my $opt_reuse = 0;
58
my $opt_age;
59
my $opt_age;
59
my $opt_dump = 0;
60
my $opt_dump = 0;
60
my $opt_images = 0;
61
my $opt_images = 0;
61
my $opt_retaincount = 2;
62
my $opt_retaincount = 2;
62
my $opt_pruneModeString;
63
my $opt_pruneModeString;
Line 68... Line 69...
68
my $opt_workDir = '/work';
69
my $opt_workDir = '/work';
69
my $opt_vobMap;
70
my $opt_vobMap;
70
my $opt_preserveProjectBase;
71
my $opt_preserveProjectBase;
71
my $opt_ignoreProjectBaseErrors;
72
my $opt_ignoreProjectBaseErrors;
72
my $opt_ignoreMakeProjectErrors;
73
my $opt_ignoreMakeProjectErrors;
-
 
74
my $opt_forceProjectBase;
-
 
75
my @opt_limitProjectBase;
-
 
76
my @opt_mergePaths;
73
my $opt_ignoreBadPaths;
77
my $opt_ignoreBadPaths;
74
my $opt_delete;
78
my $opt_delete;
75
my $opt_recentAge = 14;             # Days
79
my $opt_recentAge = 14;             # Days
76
my $opt_relabel = 0;
80
my $opt_relabel = 0;
77
my $opt_protected;
81
my $opt_protected;
78
my $opt_useSvn = 1;
82
my $opt_useSvn = 1;
79
my $opt_testRmDatabase;
83
my $opt_testRmDatabase;
80
my $opt_extractFromSvn;
84
my $opt_extractFromSvn;
-
 
85
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
-
 
86
my $opt_resume;
-
 
87
my $opt_processRipples = 1;
-
 
88
my $opt_mergePackages;
81
 
89
 
82
################################################################################
90
################################################################################
83
#   List of Projects Suffixes and Branch Names to be used within SVN
91
#   List of Projects Suffixes and Branch Names to be used within SVN
84
#
92
#
85
#       Name        - Name of branch for the project
93
#       Name        - Name of branch for the project
Line 158... Line 166...
158
    'PFTPu'                   => ',IgnoreMakeProject,',  # Looks OK
166
    'PFTPu'                   => ',IgnoreMakeProject,',  # Looks OK
159
    'WinCEBlocker'            => ',IgnoreMakeProject,',  # Looks OK
167
    'WinCEBlocker'            => ',IgnoreMakeProject,',  # Looks OK
160
    'WinCEDeviceAutoInject'   => ',IgnoreMakeProject,',  # Looks OK
168
    'WinCEDeviceAutoInject'   => ',IgnoreMakeProject,',  # Looks OK
161
    'WinCEReboot'             => ',IgnoreMakeProject,',  # Looks OK
169
    'WinCEReboot'             => ',IgnoreMakeProject,',  # Looks OK
162
 
170
 
-
 
171
    'ftp'                   => ',SetProjectBase,',
-
 
172
    'ddu_app_manager'       => ',SetProjectBase,IgnoreMakeProject,',
-
 
173
    'ddu_afc'               => ',SetProjectBase,IgnoreMakeProject,',
-
 
174
    'ddu_dog'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
175
    'ddu_management'        => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,',
-
 
176
    'ddu_fim'               => ',IgnoreMakeProject,',
-
 
177
    'ddu_mccain'            => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
178
    'ddu_mon'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle,',
-
 
179
    'ddu_rcu'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,',
-
 
180
    'ddu_status_logging'    => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle,',
-
 
181
    'ddu_logging_lib'       => ',SetProjectBase,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
182
    'verifone'              => ',ForceProjectBase=/DPG_SWCode/products/verifone,',
-
 
183
    'dm_devcdfile'          => 'AllowMultiPath',
-
 
184
    'daf_ct_mcr_unified'    => 'AllowMultiPath',
-
 
185
    'cst-rms-db'            => 'AllowMultiPath',
-
 
186
    'daf_common'            => 'IgnoreProjectBase',
-
 
187
    'devcd'                 => 'AllowMultiPath',
-
 
188
    'daf_dll'                   => 'AllowMultiPath,IgnoreMakeProject',  # MakeProject not in used makefile
-
 
189
    'daf_transap_proxyman_edf'  => 'AllowMultiPath,IgnoreProjectBase',
-
 
190
    'devrelease'                => 'AllowMultiPath',
-
 
191
 
-
 
192
    'dm_devrelease'             => 'AllowMultiPath',
-
 
193
    'dm_rtswis'                 => 'AllowMultiPath',
-
 
194
    'dm_devcd'                  => 'AllowMultiPath',
-
 
195
    'dm_documentation'          => 'AllowMultiPath,IgnoreBadPath',
-
 
196
    'dm_eventhdr'               => 'AllowMultiPath',
-
 
197
    'dm_javaenums'              => 'AllowMultiPath',
-
 
198
    'dm_solidbasetypes'         => 'AllowMultiPath',
-
 
199
    'dm_swismetadata'           => 'AllowMultiPath',
-
 
200
    'dm_cuttables'              => 'AllowMultiPath',
-
 
201
    'dm_devudapi'               => 'AllowMultiPath',
-
 
202
    'buscdapi'                  => 'AllowMultiPath',
-
 
203
    'daf_bvt'                   => 'AllowMultiPath,IgnoreMakeProject,',  # Look OK
-
 
204
    'daf_cd_transap'            => 'AllowMultiPath,IgnoreBadPath,IgnoreProjectBase',
-
 
205
    'cdref'                     => 'AllowMultiPath',
-
 
206
    'dm_sysbasetypes'           => 'AllowMultiPath',
-
 
207
    'dm_sysswis'                => 'AllowMultiPath',
-
 
208
    'dm_syscd'                  => 'AllowMultiPath',
-
 
209
    'dm_udtypes'                => 'AllowMultiPath',
-
 
210
    'dm_systemcdtables'         => 'AllowMultiPath',
-
 
211
    'dm_utils'                  => 'AllowMultiPath',
-
 
212
    'dm_udxml'                  => 'AllowMultiPath',
-
 
213
    'HCP5000_resources'         => 'AllowMultiPath',
-
 
214
    'massrtswis'                => 'AllowMultiPath',
-
 
215
    'pcp5000'                   => 'AllowMultiPath,ForceProjectBase=/DPG_SWCode',
-
 
216
    'PFTPi'                     => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',  # Looks OK
-
 
217
    'PFTPu'                     => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',  # Looks OK
-
 
218
    'WinCEBlocker'              => ',IgnoreMakeProject,',  # Looks OK
-
 
219
    'WinCEDeviceAutoInject'     => ',IgnoreMakeProject,',  # Looks OK
-
 
220
    'WinCEReboot'               => ',IgnoreMakeProject,',  # Looks OK
-
 
221
    'rsmaint'                   => 'AllowMultiPath',
-
 
222
    'sysbasetypes'              => 'AllowMultiPath',
-
 
223
    'syscd'                     => 'AllowMultiPath',
-
 
224
    'sysswis'                   => 'AllowMultiPath',
-
 
225
    'udserialiser'              => 'AllowMultiPath',
-
 
226
    'systemcdtables'            => 'AllowMultiPath',
-
 
227
    'udxml'                     => 'AllowMultiPath',
-
 
228
    'ERGoracs'                  => 'AllowMultiPath',
-
 
229
    'daf_cd_desfireparams'      => 'AllowMultiPath',
-
 
230
    'daf_ct_mag_virtual'        => 'AllowMultiPath',
-
 
231
    'daf_br_applets'            => 'AllowMultiPath',
-
 
232
    'daf_paper_variables'       => 'AllowMultiPath',
-
 
233
    'daf_transap_api'           => 'AllowMultiPath,ForceProjectBase=/DPG_SWBase/transap',
-
 
234
    'daf_br_applets'            => 'AllowMultiPath,IgnoreProjectBase',  # Not used
-
 
235
    'daf_udlib_api'             => 'AllowMultiPath,ForceProjectBase=/DPG_SWBase/ud',
-
 
236
    'daf_ct_mcr_14443'          => 'LimitProjectBase=/DPG_SWBase/ct',
-
 
237
 
-
 
238
 
-
 
239
    'daftestcd_sales'               => 'AllowMultiPath,ForceProjectBase=/ProjectCD/seattle',
-
 
240
    'daftestcd_vanpool'             => 'AllowMultiPath,ForceProjectBase=/ProjectCD',
-
 
241
    'daf_transap_edf'               => 'AllowMultiPath,IgnoreProjectBase',
-
 
242
    'daf_transap_extensions'        => 'AllowMultiPath',
-
 
243
    'daf_transap_proxyman_rkf_mag'  => 'AllowMultiPath',
-
 
244
    'daf_utils_appupgrade'          => 'AllowMultiPath',
-
 
245
    'dc5000'                        => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',
-
 
246
    'uiconv'                        => 'AllowMultiPath',
-
 
247
 
-
 
248
    'daf_ct_api'                    => 'AllowMultiPath',
-
 
249
    
-
 
250
 
-
 
251
    'ocpsupport'                    => 'AllowMultiPath,IgnoreMakeProject', # MakeProject Tested on at least one
-
 
252
    'emv_cs_test_ingenico'          => 'AllowMultiPath,IgnoreMakeProject', # MakeProject Tested on at least one
-
 
253
    'deviceicons'                   => 'AllowMultiPath,LimitProjectBase=/DPG_SWBase/resources:/DPG_SWCode/resources',
-
 
254
    'pcv_final_wce'                 => 'IgnoreMakeProject', # MakeProject Tested on at least one
-
 
255
    'pcv_wce'                       => 'IgnoreMakeProject', # MakeProject Tested on at least one
-
 
256
    'WinCEDeviceUpgrade'            => 'IgnoreMakeProject', # MakeProject Tested on at least one
-
 
257
    'scil'                          => 'LimitProjectBase=/DPG_SWCode/projects/seattle/tvm',
-
 
258
    'daf_br_compiler_support'       => 'ForceProjectBase=/DPG_SWBase/daf_br_compiler/support',
-
 
259
    'daf_br_th'                     => 'IgnoreBadPath,all,IgnoreMakeProject', # MakeProject Tested. Bad Paths not used
-
 
260
    'linux_kernel_bcp4600'          => 'ForceProjectBase=/LMOS/linux/kernel',
-
 
261
    'linux_kernel_viper'            => 'ForceProjectBase=/LMOS/linux/kernel',
-
 
262
    'linux_kernel_cobra'            => 'ForceProjectBase=/LMOS/linux/kernel',
-
 
263
 
-
 
264
    'LinuxDrivers'                  => 'flatTime,LimitProjectBase=/LMOS/linux/drivers'.
-
 
265
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper',
-
 
266
 
-
 
267
    'flashCopier'                   => 'flatTime,LimitProjectBase=/LMOS/tools/flashCopier'.
-
 
268
                                       ',mergePaths=+:src:pcp5700:eb5600:tp5600',
-
 
269
 
-
 
270
    'u-boot'                        => 'flatTime,LimitProjectBase=/LMOS/linux/bootstrap/u-boot'.
-
 
271
                                       ',mergePaths=+:src:u-boot:u-boot-hk',
-
 
272
 
-
 
273
    'dams5000'                      => 'flatTime,LimitProjectBase=/LMOS/apps/dams'.
-
 
274
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:core:doc'.
-
 
275
                                       ',processRipples',
-
 
276
 
-
 
277
    'linux_day0fs_5000'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
-
 
278
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
-
 
279
                                       ',processRipples',
-
 
280
 
-
 
281
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
-
 
282
    'rt3070'                          => 'flatVersion',
163
 
283
 
164
    'ftp'                   => 'SetProjectBase,',
-
 
165
    'ddu_app_manager'       => 'SetProjectBase,IgnoreMakeProject,',
-
 
166
    'ddu_afc'               => 'SetProjectBase,IgnoreMakeProject,',
-
 
167
    'ddu_dog'               => 'IgnoreMakeProject,',
-
 
168
    'ddu_afc'               => 'SetProjectBase,IgnoreMakeProject,',
-
 
169
 
284
 
170
    'icl'                   => 'IgnoreProjectBase,',
285
    'icl'                   => 'IgnoreProjectBase,',
171
    'itso'                  => 'IgnoreProjectBase,',
286
    'itso'                  => 'IgnoreProjectBase,',
172
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
287
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
173
    'daf_utils_mos'         => 'IgnoreProjectBase,',
288
    'daf_utils_mos'         => 'IgnoreProjectBase,',
Line 176... Line 291...
176
#    'mos_fonts'             => 'IgnoreProjectBase,',
291
#    'mos_fonts'             => 'IgnoreProjectBase,',
177
#    'sntp'                  => 'IgnoreProjectBase,',
292
#    'sntp'                  => 'IgnoreProjectBase,',
178
#    'time_it'               => 'IgnoreProjectBase,',
293
#    'time_it'               => 'IgnoreProjectBase,',
179
);
294
);
180
 
295
 
-
 
296
 
-
 
297
my %mergePathExtended = (
-
 
298
 
-
 
299
    'linux_kernel_gen1' => {
-
 
300
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
-
 
301
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
-
 
302
            },
-
 
303
 
-
 
304
);
-
 
305
 
-
 
306
 
181
my %notCots = (
307
my %notCots = (
182
    'isl'       => 1,
308
    'isl'       => 1,
183
);
309
);
184
 
310
 
185
my $ukHopsMode = 0;
311
my $ukHopsMode = 0;
Line 231... Line 357...
231
my $globalError;
357
my $globalError;
232
my @unknownProjects;
358
my @unknownProjects;
233
my %knownProjects;
359
my %knownProjects;
234
my $badSingletonCount = 0;
360
my $badSingletonCount = 0;
235
my @flatOrder;
361
my @flatOrder;
-
 
362
my $flatMode = 0;
236
my $pruneMode;
363
my $pruneMode;
237
my $pruneModeString;
364
my $pruneModeString;
238
my $threadId = 0;
365
my $threadId = 0;
239
my $threadCount;
366
my $threadCount;
240
my %tipVersions;
367
my %tipVersions;
Line 257... Line 384...
257
my $processTotal = 0;
384
my $processTotal = 0;
258
my $recentCount = 0;
385
my $recentCount = 0;
259
my $packageReLabelCount = 0;
386
my $packageReLabelCount = 0;
260
my %saneLabels;
387
my %saneLabels;
261
my $adjustedPath = 0;
388
my $adjustedPath = 0;
-
 
389
my $forceImportFlush = 0;
-
 
390
my %restoreData;
262
 
391
 
263
our $GBE_RM_URL;
392
our $GBE_RM_URL;
264
my $UNIX = $ENV{'GBE_UNIX'};
393
my $UNIX = $ENV{'GBE_UNIX'};
265
 
394
 
266
my $result = GetOptions (
395
my $result = GetOptions (
267
                "help+"         => \$opt_help,          # flag, multiple use allowed
396
                'help+'             => \$opt_help,          # flag, multiple use allowed
268
                "manual:3"      => \$opt_help,
397
                'manual:3'          => \$opt_help,
269
                "verbose:+"     => \$opt_verbose,       # Versose
398
                'verbose:+'         => \$opt_verbose,       # Versose
270
                "repository:s"  => \$opt_repo,          # Name of repository
399
                'repository:s'      => \$opt_repo,          # Name of repository
271
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
400
                'rbase:s'           => \$opt_repo_base,     # Base of the repo
272
                "flat!"         => \$opt_flat,          # Flat structure
401
                'flat!'             => \$opt_flat,          # Flat structure
273
                "test!"         => \$opt_test,          # Test operations
402
                'test!'             => \$opt_test,          # Test operations
274
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
403
                'reuse:1'           => \$opt_reuse,         # Reuse ClearCase views 0:None, 1=Retain, 2=Use+Delete
275
                "age:i"         => \$opt_age,           # Only recent versions
404
                'age:i'             => \$opt_age,           # Only recent versions
276
                "dump:1"        => \$opt_dump,          # Dump Data
405
                'dump:1'            => \$opt_dump,          # Dump Data
277
                "images:1"      => \$opt_images,        # Create DOT images
406
                'images:1'          => \$opt_images,        # Create DOT images
278
                "retain:i"      => \$opt_retaincount,   # Retain N packages
407
                'retain:i'          => \$opt_retaincount,   # Retain N packages
279
                "pruneMode:s"   => \$opt_pruneModeString,
408
                'pruneMode:s'       => \$opt_pruneModeString,
280
                "listtags:i"    => \$opt_listTags,
409
                'listtags:i'        => \$opt_listTags,
281
                "name:s"        => \$opt_name,          # Alternate output
410
                'name:s'            => \$opt_name,          # Alternate output
282
                "tip:s"         => \@opt_tip,           # Force tip version(s)
411
                'tip:s'             => \@opt_tip,           # Force tip version(s)
283
                "log!"          => \$opt_log,
412
                'log!'              => \$opt_log,
284
                "delete!"       => \$opt_delete,
413
                'delete!'           => \$opt_delete,
285
                "postimage!"    => \$opt_postimage,
414
                'postimage!'        => \$opt_postimage,
286
                'workdir:s'     => \$opt_workDir,
415
                'workdir:s'         => \$opt_workDir,
287
                'relabel!'      => \$opt_relabel,
416
                'relabel!'          => \$opt_relabel,
-
 
417
                'svn!'              => \$opt_useSvn,
-
 
418
                'testRmDatabase'    => \$opt_testRmDatabase,
-
 
419
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
420
                'resume'            => \$opt_resume,
-
 
421
                'mergePackages:s'   => \$opt_mergePackages,
-
 
422
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
-
 
423
                
288
                'svn!'          => \$opt_useSvn,
424
                'svn!'          => \$opt_useSvn,
289
                'testRmDatabase'    => \$opt_testRmDatabase,
425
                'testRmDatabase'    => \$opt_testRmDatabase,
290
                'fromSvn!'          => \$opt_extractFromSvn,
426
                'fromSvn!'          => \$opt_extractFromSvn,
291
                );
427
                );
292
 
428
 
Line 327... Line 463...
327
#   Init the pruning mode
463
#   Init the pruning mode
328
#
464
#
329
setPruneMode( $opt_pruneModeString || 'ripple');
465
setPruneMode( $opt_pruneModeString || 'ripple');
330
 
466
 
331
#
467
#
-
 
468
#   Detect Merge Package Request
-
 
469
#   These use pre-configured bits
-
 
470
#
-
 
471
if ( $opt_mergePackages )
-
 
472
{
-
 
473
    if ( $opt_mergePackages eq 'LinuxDrivers' )
-
 
474
    {
-
 
475
        $opt_name = $opt_mergePackages;
-
 
476
        @ARGV = qw (linux_drivers_eb5600
-
 
477
                    linux_drivers_viper
-
 
478
                    linux_drivers_cobra
-
 
479
                    linux_drivers_etx86
-
 
480
                    linux_drivers_tp5600);
-
 
481
#                    linux_drivers_bcp4600
-
 
482
                    
-
 
483
 
-
 
484
    } elsif ( $opt_mergePackages eq 'flashCopier' ) {
-
 
485
        $opt_name = $opt_mergePackages;
-
 
486
        @ARGV = qw (
-
 
487
                flash_copier_eb5600
-
 
488
                flash_copier_pcp5700
-
 
489
                flash_copier_tp5600
-
 
490
                );
-
 
491
 
-
 
492
    } elsif ( $opt_mergePackages eq 'u-boot' ) {
-
 
493
        $opt_name = $opt_mergePackages;
-
 
494
        @ARGV = qw (
-
 
495
                u-boot
-
 
496
                u-boot-hk
-
 
497
                );
-
 
498
 
-
 
499
    } elsif ( $opt_mergePackages eq 'dams5000' ) {
-
 
500
        $opt_name = $opt_mergePackages;
-
 
501
        @ARGV = qw (
-
 
502
                    dams_eb5600
-
 
503
                    dams_pcp5700
-
 
504
                    dams_tp5600
-
 
505
                );
-
 
506
 
-
 
507
    } elsif ( $opt_mergePackages eq 'linux_day0fs_5000' ) {
-
 
508
        $opt_name = $opt_mergePackages;
-
 
509
        @ARGV = qw (
-
 
510
                    linux_day0fs_eb5600
-
 
511
                    linux_day0fs_tp5600
-
 
512
                    linux_day0fs_etx86
-
 
513
                );
-
 
514
 
-
 
515
    } elsif ( $opt_mergePackages eq 'linux_kernel_gen1' ) {
-
 
516
        $opt_name = $opt_mergePackages;
-
 
517
        @ARGV = qw (
-
 
518
                    linux_kernel_etx86
-
 
519
                    linux_kernel_tp5600
-
 
520
                    linux_kernel_eb5600
-
 
521
                    linux_kernel_bcp4600
-
 
522
                );
-
 
523
 
-
 
524
    } else
-
 
525
    {
-
 
526
        Error ("Unknown Merge Package Name: $opt_mergePackages");
-
 
527
    }
-
 
528
}
332
#   Get data for all packages
529
#   Get data for all packages
333
#
530
#
334
foreach my $packageName ( @ARGV )
531
foreach my $packageName ( @ARGV )
335
{
532
{
336
    next unless ( $packageName );
533
    next unless ( $packageName );
Line 387... Line 584...
387
smartPackageType();                 # Determine special prune mode
584
smartPackageType();                 # Determine special prune mode
388
ReportPathVariance();
585
ReportPathVariance();
389
massageData();
586
massageData();
390
getSvnData();
587
getSvnData();
391
smartPackageType();                 # Have another go
588
smartPackageType();                 # Have another go
-
 
589
restoreData() if ( $opt_resume );
392
 
590
 
393
my @missedTips = keys %tipVersions;
591
my @missedTips = keys %tipVersions;
394
Error ("Specified tip version not found: @missedTips") if ( @missedTips );
592
Error ("Specified tip version not found: @missedTips") if ( @missedTips );
395
 
593
 
396
if ( $opt_flat )
594
if ( $opt_flat )
397
{
595
{
398
#    @flatOrder = sort {$versions{$a}{version} cmp $versions{$b}{version}} keys(%versions);
596
#    @flatOrder = sort {$versions{$a}{version} cmp $versions{$b}{version}} keys(%versions);
399
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
597
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
-
 
598
 
-
 
599
    if ( $flatMode == 1 ) {
-
 
600
        Message ("Flat import. Sorted by TimeStamp");
-
 
601
        @flatOrder = sort {$versions{$a}{TimeStamp} cmp $versions{$b}{TimeStamp}} keys(%versions);
-
 
602
    } elsif ( $flatMode == 2 ) {
-
 
603
        Message ("Flat import. Sorted by Version");
-
 
604
 
-
 
605
        # Only iff all the bits are numeric
-
 
606
        sub sortCotsVersion
-
 
607
        {
-
 
608
            my @va = split '\.', $versions{$a}{vname};
-
 
609
            my @vb = split '\.', $versions{$b}{vname};
-
 
610
 
-
 
611
            my $rv = scalar @va <=> scalar @vb;
-
 
612
            return $rv if ( $rv );
-
 
613
 
-
 
614
            foreach my $ii ( 0 .. scalar @va )
-
 
615
            {
-
 
616
                $rv = $va[$ii] <=> $vb[$ii];
-
 
617
                return $rv if ( $rv );
-
 
618
            }
-
 
619
            return $rv;
-
 
620
        }
-
 
621
 
-
 
622
        @flatOrder = sort sortCotsVersion keys(%versions);
-
 
623
#        @flatOrder = sort {$versions{$a}{vname} cmp $versions{$b}{vname}} keys(%versions);
-
 
624
    } else {
400
    @flatOrder = sort {$a <=> $b} keys(%versions);
625
        @flatOrder = sort {$a <=> $b} keys(%versions);
-
 
626
    }
401
    my $tip = $flatOrder[-1];
627
    my $tip = $flatOrder[-1];
402
    $versions{$tip}{Tip} = 1 if $tip;
628
    $versions{$tip}{Tip} = 1 if $tip;
403
}
629
}
404
 
630
 
405
#
631
#
Line 458... Line 684...
458
    #   Going to do serious work
684
    #   Going to do serious work
459
    #   Need to ensure we have more arguments
685
    #   Need to ensure we have more arguments
460
    #
686
    #
461
    if ( $opt_protected )
687
    if ( $opt_protected )
462
    {
688
    {
463
        Warning("Protected Package not transferred: $packageNames[0] - $opt_protected",
689
        Warning("Protected Package not transferred: $packageNames - $opt_protected",
464
                "See cc2svn_protected.txt for details");
690
                "See cc2svn_protected.txt for details");
465
        exit 0;
691
        exit 0;
466
    }
692
    }
467
 
693
 
468
    if ( $noTransfer )
694
    if ( $noTransfer )
469
    {
695
    {
470
        Warning("Protected Package not transferred: $packageNames[0]",
696
        Warning("Protected Package not transferred: $packageNames",
471
                "Configured within this program");
697
                "Configured within this program");
472
        exit 0;
698
        exit 0;
473
    }
699
    }
474
 
700
 
475
    #
701
    #
Line 625... Line 851...
625
        $opt_flat = 1;
851
        $opt_flat = 1;
626
        setPruneMode('none') unless (defined $opt_pruneModeString);
852
        setPruneMode('none') unless (defined $opt_pruneModeString);
627
    }
853
    }
628
 
854
 
629
 
855
 
630
    if ( $packageNames[0] =~ m'^br_applet_' )
856
    if ( $packageNames =~ m'^br_applet_' )
631
    {
857
    {
632
      $opt_flat = 1 unless defined $opt_flat;
858
      $opt_flat = 1 unless defined $opt_flat;
633
    }
859
    }
634
 
860
 
635
    if ( exists $specialPackages{$packageNames[0]} )
861
    if ( exists $specialPackages{$packageNames} )
636
    {
862
    {
637
        my $data = $specialPackages{$packageNames[0]};
863
        my $data = ',' . $specialPackages{$packageNames} . ',';
-
 
864
 
638
        if ( index( $data, ',all' ) >= 0) {
865
        if ( index( $data, ',all' ) >= 0) {
639
            setPruneMode('none') unless (defined $opt_pruneModeString);
866
            setPruneMode('none') unless (defined $opt_pruneModeString);
640
        }
867
        }
641
        
868
        
642
        if ( index( $data, 'protected,' ) >= 0) {
869
        if ( index( $data, ',protected,' ) >= 0) {
643
            $noTransfer = 1;
870
            $noTransfer = 1;
644
        }
871
        }
645
 
872
 
646
        if ( index( $data, 'flat,' ) >= 0) {
873
        if ( index( $data, ',flat,' ) >= 0) {
647
            $opt_flat = 1;
874
            $opt_flat = 1;
648
        }
875
        }
649
 
876
 
-
 
877
        if ( index( $data, ',flatTime,' ) >= 0) {
-
 
878
            Message ("Flatten import tree. Sort by Time");
-
 
879
            $opt_flat = 1;
-
 
880
            $flatMode = 1;          # By Time
-
 
881
            $opt_processRipples = 0;
-
 
882
        }
-
 
883
 
-
 
884
        if ( index( $data, ',flatVersion,' ) >= 0) {
-
 
885
            Message ("Flatten import tree. Sort by Version");
-
 
886
            $opt_flat = 1;
-
 
887
            $flatMode = 2;          # By Version
-
 
888
            $opt_processRipples = 0;
-
 
889
        }
-
 
890
        
-
 
891
 
-
 
892
        if ( index( $data, ',processRipples,' ) >= 0) {
-
 
893
            $opt_processRipples = 1;
-
 
894
        }
-
 
895
 
650
        if ( index( $data, 'SetProjectBase,' ) >= 0) {
896
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
651
            $opt_preserveProjectBase = 1;
897
            $opt_preserveProjectBase = 1;
652
            $opt_ignoreProjectBaseErrors = 1;
898
            $opt_ignoreProjectBaseErrors = 1;
653
            Message ("Preserving ProjectBase");
899
            Message ("Preserving ProjectBase");
654
        }
900
        }
655
 
901
 
-
 
902
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
-
 
903
            $opt_AllowMuliplePaths = 1;
-
 
904
            Message ("Allowing Multiple Paths");
-
 
905
        }
-
 
906
 
-
 
907
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
-
 
908
            $opt_forceProjectBase = $1;
-
 
909
            $opt_AllowMuliplePaths = 1;
-
 
910
            Message ("Force Project Base: $opt_forceProjectBase");
-
 
911
        }
-
 
912
 
-
 
913
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
-
 
914
            $opt_AllowMuliplePaths = 1;
-
 
915
            @opt_limitProjectBase = split(':', $1);
-
 
916
            Message ("Limit Project Base: @opt_limitProjectBase");
-
 
917
        }
-
 
918
 
-
 
919
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
-
 
920
            @opt_mergePaths = split(':', $1);
-
 
921
            Message ("Merge Paths: @opt_mergePaths");
-
 
922
        }
-
 
923
 
656
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
924
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
657
            $opt_ignoreProjectBaseErrors = 1;
925
            $opt_ignoreProjectBaseErrors = 1;
658
            Message ("Ignore ProjectBase Errors");
926
            Message ("Ignore ProjectBase Errors");
659
        }
927
        }
660
 
928
 
661
        if ( index( $data, 'IgnoreMakeProject,' ) >= 0) {
929
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
662
            $opt_ignoreMakeProjectErrors = 1;
930
            $opt_ignoreMakeProjectErrors = 1;
663
            Message ("Ignore MakeProject Usage");
931
            Message ("Ignore MakeProject Usage");
664
        }
932
        }
665
 
933
 
666
        if ( index( $data, 'IgnoreBadPath,' ) >= 0) {
934
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
667
            $opt_ignoreBadPaths = 1;
935
            $opt_ignoreBadPaths = 1;
668
            Message ("Ignore Bad Paths in makefilest Usage");
936
            Message ("Ignore Bad Paths in makefile Usage");
669
        }
937
        }
670
        
938
        
671
        if ( index( $data, 'utf8,' ) >= 0) {
939
        if ( index( $data, ',utf8,' ) >= 0) {
672
            $mustConvertFileNames = 1;
940
            $mustConvertFileNames = 1;
673
            Message ("Convert filenames to UTF8");
941
            Message ("Convert filenames to UTF8");
674
        }
942
        }
675
    }
943
    }
676
 
944
 
Line 979... Line 1247...
979
        }
1247
        }
980
    }
1248
    }
981
    
1249
    
982
    #
1250
    #
983
    #   Prune
1251
    #   Prune
984
    #   Marks paths to root for all essential packages
1252
    #       Marks paths to root for all essential packages
985
    #   Marks the last-N from all essential packages
1253
    #       Marks the last-N from all essential packages
986
    #
1254
    #
987
    if ( $pruneMode )
1255
    if ( $pruneMode )
988
    {
1256
    {
989
        Message ("Prune Tree: $pruneModeString");
1257
        Message ("Prune Tree: $pruneModeString");
990
        foreach ( @EssentialPackages )
1258
        foreach ( @EssentialPackages )
Line 1010... Line 1278...
1010
        #
1278
        #
1011
        #   Keep recent versions
1279
        #   Keep recent versions
1012
        #       Keep versions created in the last N days
1280
        #       Keep versions created in the last N days
1013
        #       Will keep recent ripples too
1281
        #       Will keep recent ripples too
1014
        #
1282
        #
1015
        if ( $pruneMode == 1 )
1283
        if ( $pruneMode == 1 )                      # 1 == ripple
1016
        {
1284
        {
1017
            foreach my $entry ( keys(%versions) )
1285
            foreach my $entry ( keys(%versions) )
1018
            {
1286
            {
1019
                next unless ( $versions{$entry}{Age} <= $opt_recentAge  );
1287
                next unless ( $versions{$entry}{Age} <= $opt_recentAge  );
1020
                $versions{$entry}{keepRecent} = 1;
1288
                $versions{$entry}{keepRecent} = 1;
1021
                $recentCount++;
1289
                $recentCount++;
1022
#print "--- Recent version $versions{$entry}{vname}, $versions{$entry}{Age} <= $opt_recentAge\n";
1290
#print "--- Recent version $versions{$entry}{vname}, $versions{$entry}{Age} <= $opt_recentAge\n";
1023
            }
1291
            }
1024
 
1292
 
1025
#            #
1293
            #
1026
#            #   Keep the tip of each branch
1294
            #   Keep the tip of each branch
1027
#            #
1295
            #
1028
#            foreach my $entry ( @endPoints )
1296
            foreach my $entry ( @endPoints )
1029
#            {
1297
            {
-
 
1298
#print "--- Tip version $versions{$entry}{vname}\n";
-
 
1299
                my $count = 0;
-
 
1300
                while ( $entry && $count < 2)
-
 
1301
                {
1030
#                next if exists $versions{$entry}{keepRecent};
1302
                    last if ( $versions{$entry}{Essential} );
1031
#                $versions{$entry}{keepRecent} = 1;
1303
                    last if ( $versions{$entry}{keepRecent} );
-
 
1304
 
-
 
1305
                    next if ( $versions{$entry}{locked} eq 'N'  );
-
 
1306
                    next if ( $versions{$entry}{DeadWood} );
-
 
1307
 
1032
##print "--- Tip version $versions{$entry}{vname}\n";
1308
#print "--- Keeping Tip version $versions{$entry}{vname}\n";
-
 
1309
                    $versions{$entry}{keepRecent} = 1;
-
 
1310
                    $count++;
-
 
1311
 
-
 
1312
                } continue {
-
 
1313
                    $entry = $versions{$entry}{last};
-
 
1314
                }
1033
#            }
1315
            }
1034
        }
1316
        }
1035
        
1317
        
1036
        #
1318
        #
1037
        #   Keep versions that are common parents to Essential Versions
1319
        #   Keep versions that are common parents to Essential Versions
1038
        #       Mark paths through the tree to essential versions
1320
        #       Mark paths through the tree to essential versions
Line 1104... Line 1386...
1104
            return 0 if ( ($pruneMode == 1) && ! $versions{$entry}{isaRipple} );
1386
            return 0 if ( ($pruneMode == 1) && ! $versions{$entry}{isaRipple} );
1105
            return 0 if ( exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
1387
            return 0 if ( exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
1106
            return 1;
1388
            return 1;
1107
        }
1389
        }
1108
 
1390
 
-
 
1391
 
-
 
1392
        #
-
 
1393
        #   Determine a list of entries to be pruned
-
 
1394
        #   Done in two steps so that we can skip the pruning if its only a small number
-
 
1395
        #
-
 
1396
        my @pruneList;
1109
        foreach my $entry ( keys(%versions) )
1397
        foreach my $entry ( keys(%versions) )
1110
        {
1398
        {
-
 
1399
            push ( @pruneList, $entry ) if ( pruneMe($entry) );
-
 
1400
        }
-
 
1401
 
-
 
1402
 
-
 
1403
        #
-
 
1404
        #   If the list is very small then just import all of them
1111
#last;
1405
        #
-
 
1406
        if ( scalar @pruneList < 10 )
-
 
1407
        {
-
 
1408
            Message ("Retaining pruned entries - low count:" . scalar @pruneList );
-
 
1409
            @pruneList = ();
-
 
1410
        } else {
-
 
1411
            my $total = scalar keys %versions;
-
 
1412
 
-
 
1413
            if ( scalar @pruneList < ($total / 15))
-
 
1414
            {
-
 
1415
                Message ("Retaining pruned entries - low percentage of $total:" . scalar @pruneList );
1112
            next unless ( pruneMe($entry) );
1416
                @pruneList = ();
-
 
1417
            }
-
 
1418
        }
-
 
1419
        
-
 
1420
 
-
 
1421
        foreach my $entry (@pruneList )
-
 
1422
        {
1113
#print "--- Prune: $versions{$entry}{vname}\n";
1423
#print "--- Prune: $versions{$entry}{vname}\n";
1114
 
1424
 
1115
            # Delete the current node
1425
            # Delete the current node
1116
            #
1426
            #
1117
            my @newNext;
1427
            my @newNext;
Line 1503... Line 1813...
1503
        {
1813
        {
1504
            newProject();
1814
            newProject();
1505
            $createBranch = 1;
1815
            $createBranch = 1;
1506
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1816
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1507
        }
1817
        }
1508
 
-
 
1509
        newPackageVersion( $entry );
1818
        newPackageVersion( $entry );
-
 
1819
 
1510
no warnings "recursion";
1820
no warnings "recursion";
1511
        processBranch (@{$versions{$entry}{next}});
1821
        processBranch (@{$versions{$entry}{next}});
1512
    }
1822
    }
1513
}
1823
}
1514
 
1824
 
Line 1607... Line 1917...
1607
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1917
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1608
 
1918
 
1609
    #
1919
    #
1610
    #   Sava data
1920
    #   Sava data
1611
    #
1921
    #
-
 
1922
    if ( $rv != 6 )
-
 
1923
    {
1612
    $data{errFlags} = $flags;
1924
        $data{errFlags} = $flags;
1613
    $data{duration} = $duration;
1925
        $data{duration} = $duration;
-
 
1926
    }
1614
    $versions{$entry}{rmRef} = $data{rmRef};
1927
    $versions{$entry}{rmRef} = $data{rmRef};
1615
    delete $data{rmRef};
1928
    delete $data{rmRef};
1616
    delete $data{tag};
1929
    delete $data{tag};
1617
    ##delete $data{ViewRoot};
1930
    ##delete $data{ViewRoot};
1618
    $versions{$entry}{data} = \%data;
1931
    $versions{$entry}{data} = \%data;
Line 1621... Line 1934...
1621
    #   Delete the created view
1934
    #   Delete the created view
1622
    #   Its just a directory, so delete it
1935
    #   Its just a directory, so delete it
1623
    #
1936
    #
1624
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1937
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1625
    {
1938
    {
1626
        if ( !$opt_reuse || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
1939
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
1627
        {
1940
        {
1628
            Message ("Delete View: $data{ViewRoot}");
1941
            Message ("Delete View: $data{ViewRoot}");
1629
            RmDirTree ($data{ViewRoot} );
1942
            RmDirTree ($data{ViewRoot} );
1630
        }
1943
        }
1631
        else
1944
        else
Line 1637... Line 1950...
1637
    else
1950
    else
1638
    {
1951
    {
1639
        Message ("No view to delete");
1952
        Message ("No view to delete");
1640
    }
1953
    }
1641
 
1954
 
1642
 
-
 
1643
    #
1955
    #
1644
    #   If this version has any 'ripples' then process them while we have the
-
 
1645
    #   main view. Note the ripple list may contain entries that do not
-
 
1646
    #   exist - they will have been pruned.
1956
    #   Create pretty pictures
1647
    #
1957
    #
1648
if(1) {
1958
    unless ( $rv )
1649
    foreach my $rentry ( @{$versions{$entry}{rippleList}} )
-
 
1650
    {
1959
    {
1651
        next unless( exists $versions{$rentry} );
1960
        getSvnData();
-
 
1961
        createImages();
-
 
1962
    }
1652
 
1963
 
-
 
1964
 
-
 
1965
    if($opt_processRipples)
-
 
1966
    {
-
 
1967
        #
-
 
1968
        #   If this version has any 'ripples' then process them while we have the
-
 
1969
        #   main view. Note the ripple list may contain entries that do not
-
 
1970
        #   exist - they will have been pruned.
-
 
1971
        #
1653
        if ($versions{$rentry}{Processed})
1972
        foreach my $rentry ( @{$versions{$entry}{rippleList}} )
1654
        {
1973
        {
1655
            Warning ("Ripple Processed before main entry");
1974
            next unless( exists $versions{$rentry} );
1656
            $versions{$rentry}{rippleProcessed} = 1;
-
 
1657
        }
-
 
1658
 
1975
 
-
 
1976
            if ($versions{$rentry}{Processed})
-
 
1977
            {
-
 
1978
                Warning ("Ripple Processed before main entry");
-
 
1979
                $versions{$rentry}{rippleProcessed} = 1;
-
 
1980
            }
-
 
1981
 
1659
        Message ("Proccessing associated Ripple: " . GetVname($rentry));
1982
            Message ("Proccessing associated Ripple: " . GetVname($rentry));
1660
        newPackageVersion($rentry);
1983
            newPackageVersion($rentry);
-
 
1984
        }
1661
    }
1985
    }
1662
}
1986
 
1663
}
1987
}
1664
 
1988
 
1665
#-------------------------------------------------------------------------------
1989
#-------------------------------------------------------------------------------
1666
# Function        : newPackageVersionBody
1990
# Function        : newPackageVersionBody
1667
#
1991
#
Line 1682... Line 2006...
1682
#                                   No Files in the extracted view after labeling dirs
2006
#                                   No Files in the extracted view after labeling dirs
1683
#                               3 - Deadwood
2007
#                               3 - Deadwood
1684
#                               4 - Bad usage of ProjectBase detected
2008
#                               4 - Bad usage of ProjectBase detected
1685
#                                   Use of MakeProject detected
2009
#                                   Use of MakeProject detected
1686
#                               5  - Subversion Import disabled
2010
#                               5  - Subversion Import disabled
-
 
2011
#                               6  - Restored via resume
1687
#                       >10 - Fatal error
2012
#                       >10 - Fatal error
1688
#
2013
#
1689
sub newPackageVersionBody
2014
sub newPackageVersionBody
1690
{
2015
{
1691
    my ($data, $entry) = @_;
2016
    my ($data, $entry) = @_;
Line 1709... Line 2034...
1709
    SystemConfig ('ExitOnError' => 0);
2034
    SystemConfig ('ExitOnError' => 0);
1710
 
2035
 
1711
    push @processOrder, $entry;
2036
    push @processOrder, $entry;
1712
    return 0 if ( $opt_test );
2037
    return 0 if ( $opt_test );
1713
 
2038
 
-
 
2039
    #
-
 
2040
    #   Calculate the label for the target package
-
 
2041
    #   Use format <packageName>_<PackageVersion>
-
 
2042
    #   Need to handle WIPs too.
-
 
2043
    #
-
 
2044
    my $import_label = saneLabel($entry);
-
 
2045
 
-
 
2046
    #
-
 
2047
    #   If resuming - then test existence
-
 
2048
    #
-
 
2049
    if ( $opt_resume )
-
 
2050
    {
-
 
2051
        if ( exists $restoreData{$entry}  )
-
 
2052
        {
-
 
2053
 
-
 
2054
            #
-
 
2055
            #   May be able to test existence by looking at $versions{$entry}{svnVersion}
-
 
2056
            #   The hard work may have been done
-
 
2057
            #
-
 
2058
            my $isInSvn = 0;
-
 
2059
            if ( exists $versions{$entry}{svnVersion} && $versions{$entry}{svnVersion}  )
-
 
2060
            {
-
 
2061
                $isInSvn = 1;
-
 
2062
            }
-
 
2063
            Message("SvnVersion check: $isInSvn");
-
 
2064
 
-
 
2065
            $rv = testSvnLabel( "$svnRepo/$packageNames", $import_label );
-
 
2066
            unless ( $rv )
-
 
2067
            {
-
 
2068
                Message ("Skip import - resume detected presense");
-
 
2069
                $firstVersionCreated = $entry unless ( $firstVersionCreated );
-
 
2070
                $versions{$entry}{TagCreated} = 2;
-
 
2071
                foreach  ( keys %{$restoreData{$entry}} )
-
 
2072
                {
-
 
2073
                    $data->{$_} = $restoreData{$entry}{$_};
-
 
2074
                }
-
 
2075
                $forceImportFlush = 1;
-
 
2076
DebugDumpData('Data', $data );
-
 
2077
                return 6;
-
 
2078
            }
-
 
2079
        }
-
 
2080
        else
-
 
2081
        {
-
 
2082
            Warning ("Resume data missing");
-
 
2083
        }
-
 
2084
    }
-
 
2085
    
1714
#   Keep DeadWood. May be a WIP
2086
#   Keep DeadWood. May be a WIP
1715
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
2087
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
1716
#    {
2088
#    {
1717
#        $data->{errStr} = 'Package is DeadWood';
2089
#        $data->{errStr} = 'Package is DeadWood';
1718
#        return 3;
2090
#        return 3;
Line 1726... Line 2098...
1726
    {
2098
    {
1727
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
2099
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
1728
                 "Tag: $data->{tag}" );
2100
                 "Tag: $data->{tag}" );
1729
        $data->{errStr} = 'VCS Tag Marked as Bad';
2101
        $data->{errStr} = 'VCS Tag Marked as Bad';
1730
        return 1;
2102
        return 1;
-
 
2103
 
1731
    }
2104
    }
1732
 
2105
 
1733
 
2106
 
1734
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
2107
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
1735
    $vcs_type = $1;
2108
    $vcs_type = $1;
Line 1808... Line 2181...
1808
            {
2181
            {
1809
                $cc_path = '/MREF_Package';
2182
                $cc_path = '/MREF_Package';
1810
            }
2183
            }
1811
        }
2184
        }
1812
 
2185
 
-
 
2186
        $cc_path = $opt_forceProjectBase
-
 
2187
            if ( $opt_forceProjectBase );
-
 
2188
 
-
 
2189
        foreach ( @opt_limitProjectBase )
-
 
2190
        {
-
 
2191
            if ( $cc_path =~ m~$_~ )
-
 
2192
            {
-
 
2193
                $cc_path = $_;
-
 
2194
                last;
-
 
2195
            }
-
 
2196
        }
-
 
2197
        
1813
        if ( $cc_path_original ne $cc_path )
2198
        if ( $cc_path_original ne $cc_path )
1814
        {
2199
        {
1815
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2200
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
1816
        }
2201
        }
1817
    }
2202
    }
Line 1839... Line 2224...
1839
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2224
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
1840
    #
2225
    #
1841
    #   Attempt to suck up empty directories below the specified
2226
    #   Attempt to suck up empty directories below the specified
1842
    #   source path
2227
    #   source path
1843
    #
2228
    #
1844
    unless ( $opt_preserveProjectBase )
2229
    unless ( $opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase)
1845
    {
2230
    {
1846
        #
2231
        #
1847
        #   Look in ViewPath
2232
        #   Look in ViewPath
1848
        #   If it contains only ONE directory then we can suck it up
2233
        #   If it contains only ONE directory then we can suck it up
1849
        #
2234
        #
Line 1883... Line 2268...
1883
    {
2268
    {
1884
        unless ( $opt_ignoreProjectBaseErrors )
2269
        unless ( $opt_ignoreProjectBaseErrors )
1885
        {
2270
        {
1886
            $data->{BadProjectBase}++;
2271
            $data->{BadProjectBase}++;
1887
            $data->{errStr} = 'Bad usage of ProjectBase detected';
2272
            $data->{errStr} = 'Bad usage of ProjectBase detected';
-
 
2273
            Warning ("ProjectBase Error");
1888
            return 4;           # Lets see what the others look like too
2274
            return 4;           # Lets see what the others look like too
1889
#            return 14;
2275
#            return 14;
1890
        }
2276
        }
1891
    }
2277
    }
1892
 
2278
 
Line 1986... Line 2372...
1986
        $data->{errStr} = 'Failed to create Package';
2372
        $data->{errStr} = 'Failed to create Package';
1987
        return 10;
2373
        return 10;
1988
    }
2374
    }
1989
 
2375
 
1990
    #
2376
    #
1991
    #   Calculate the label for the target package
-
 
1992
    #   Use format <packageName>_<PackageVersion>
-
 
1993
    #   Need to handle WIPs too.
-
 
1994
    #
-
 
1995
    my $import_label = saneLabel($entry);
-
 
1996
 
-
 
1997
    #
-
 
1998
    #   May need to create the branchpoint
2377
    #   May need to create the branchpoint
1999
    #   The process is delayed until its needed so avoid creating unneeded
2378
    #   The process is delayed until its needed so avoid creating unneeded
2000
    #   branch points
2379
    #   branch points
2001
    #
2380
    #
2002
    if ( $createBranch )
2381
    if ( $createBranch )
Line 2008... Line 2387...
2008
        {
2387
        {
2009
            $data->{errStr} = 'Failed to create Branch Point';
2388
            $data->{errStr} = 'Failed to create Branch Point';
2010
            return 11;
2389
            return 11;
2011
        }
2390
        }
2012
    }
2391
    }
2013
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
-
 
2014
 
2392
 
-
 
2393
    #
-
 
2394
    #   If we are in resume mode then we MUST kill the import directory
-
 
2395
    #   if we have skipped anything
-
 
2396
    #
-
 
2397
    if ( $forceImportFlush )
-
 
2398
    {
-
 
2399
        $forceImportFlush = 0;
-
 
2400
        RmDirTree ('SvnImportDir');
-
 
2401
    }
-
 
2402
 
-
 
2403
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2015
    my $datafile = "importdata.$import_label.properties";
2404
    my $datafile = "importdata.$import_label.properties";
-
 
2405
 
-
 
2406
    my @mergeArg;
-
 
2407
    push (@mergeArg, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
-
 
2408
 
-
 
2409
    if ( exists $mergePathExtended{$packageNames}  )
-
 
2410
    {
-
 
2411
        my $eentry = $mergePathExtended{$packageNames};
-
 
2412
        if ( exists $eentry->{$import_label} )
-
 
2413
        {
-
 
2414
            @opt_mergePaths = split(':', $eentry->{$import_label});
-
 
2415
            Message("New MergePath Info: @opt_mergePaths");
-
 
2416
 
-
 
2417
            #
-
 
2418
            #   Args take effect next version
-
 
2419
            #   In this version have no merging - reset the image
-
 
2420
            #
-
 
2421
            @mergeArg = ();
-
 
2422
        }
-
 
2423
    }
-
 
2424
 
2016
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2425
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2017
                    "-package=$svnRepo/$packageNames",
2426
                    "-package=$svnRepo/$packageNames",
2018
                    "-dir=$data->{ViewPath}",
2427
                    "-dir=$data->{ViewPath}",
2019
                    "-label=$import_label",
2428
                    "-label=$import_label",
2020
                    "-datafile=$datafile",
2429
                    "-datafile=$datafile",
2021
                    @args,
2430
                    @args,
-
 
2431
                    @mergeArg,
2022
                     );
2432
                     );
2023
 
2433
 
2024
    if ( $rv )
2434
    if ( $rv )
2025
    {
2435
    {
2026
        $data->{errStr} = 'Failed to import to SVN';
2436
        $data->{errStr} = 'Failed to import to SVN';
Line 2035... Line 2445...
2035
    #   Retain entries in a global file
2445
    #   Retain entries in a global file
2036
    #
2446
    #
2037
    if ( -f $datafile  )
2447
    if ( -f $datafile  )
2038
    {
2448
    {
2039
        my $rmData = JatsProperties::New($datafile);
2449
        my $rmData = JatsProperties::New($datafile);
-
 
2450
        if ( $rmData->getProperty('subversion.tag') )
-
 
2451
        {
2040
        $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
2452
            $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
-
 
2453
        }
-
 
2454
        else
-
 
2455
        {
-
 
2456
            Warning ("Property files has no subversion.tag");
-
 
2457
        }
-
 
2458
        $data->{fileCount}    = $rmData->getProperty('files.base', 0);
-
 
2459
        $data->{filesRemoved} = $rmData->getProperty('files.removed',0);
-
 
2460
        $data->{filesAdded}   = $rmData->getProperty('files.added',0);
2041
    }
2461
    }
2042
 
2462
 
2043
    unless ( $data->{rmRef}  )
2463
    unless ( $data->{rmRef}  )
2044
    {
2464
    {
2045
        $data->{errStr} = 'Failed to determine Rm Reference';
2465
        $data->{errStr} = 'Failed to determine Rm Reference';
Line 2176... Line 2596...
2176
    push (@opts, '-author', $author) if ( $author );
2596
    push (@opts, '-author', $author) if ( $author );
2177
    #
2597
    #
2178
    #   Only do once
2598
    #   Only do once
2179
    #
2599
    #
2180
    return unless ( $createPackageDone );
2600
    return unless ( $createPackageDone );
-
 
2601
    return if ( $opt_resume );
2181
    $createPackageDone = 0;
2602
    $createPackageDone = 0;
2182
 
2603
 
2183
    #
2604
    #
2184
    #   Real import
2605
    #   Real import
2185
    #       Do not Delete package if it exists
2606
    #       Do not Delete package if it exists
Line 2341... Line 2762...
2341
    #
2762
    #
2342
    #   Perform the branch
2763
    #   Perform the branch
2343
    #
2764
    #
2344
    if ( defined $src_label )
2765
    if ( defined $src_label )
2345
    {
2766
    {
-
 
2767
        if ( $opt_resume )
-
 
2768
        {
-
 
2769
            my $rv = JatsToolPrint ( 'jats_svnlabel',
-
 
2770
                        '-check',
-
 
2771
                        '-packagebase', "$svnRepo/$packageNames",
-
 
2772
                        '-branch',
-
 
2773
                        $tgt_label );
-
 
2774
            return unless ( $rv );
-
 
2775
        }
-
 
2776
 
2346
        #
2777
        #
2347
        #   The 'clone' operation will backtrack the branch point
2778
        #   The 'clone' operation will backtrack the branch point
2348
        #   to the source of the label. This will make the output version
2779
        #   to the source of the label. This will make the output version
2349
        #   tree much prettier
2780
        #   tree much prettier
2350
        #
2781
        #
Line 2389... Line 2820...
2389
    #
2820
    #
2390
    foreach my $entry ( @processOrder )
2821
    foreach my $entry ( @processOrder )
2391
    {
2822
    {
2392
        $versions{$entry}{Scanned} = 1;
2823
        $versions{$entry}{Scanned} = 1;
2393
        next unless ( $versions{$entry}{TagCreated} );
2824
        next unless ( $versions{$entry}{TagCreated} );
-
 
2825
        my $eflag = $versions{$entry}{Essential} ? 'E' : ' ';
2394
        Warning ("Processed: " . GetVname($entry) . ' :: ' . $versions{$entry}{rmRef} || $versions{$entry}{errStr} || '???' );
2826
        Warning ("Processed:$eflag:" . GetVname($entry) . ' :: ' . $versions{$entry}{rmRef} || $versions{$entry}{errStr} || '???' );
2395
    }
2827
    }
2396
 
2828
 
2397
    #
2829
    #
2398
    #   Display versions that did not get created
2830
    #   Display versions that did not get created
2399
    #
2831
    #
Line 2409... Line 2841...
2409
            next;
2841
            next;
2410
        }
2842
        }
2411
 
2843
 
2412
        my $reason = $versions{$entry}{data}{errStr} || '';
2844
        my $reason = $versions{$entry}{data}{errStr} || '';
2413
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
2845
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
-
 
2846
        my $eflag = $versions{$entry}{Essential} ? 'E' : ' ';
2414
        Warning ("Not Processed: " . GetVname($entry) . ':' . $tag . ' : ' . $reason );
2847
        Warning ("Not Processed:$eflag: " . GetVname($entry) . ':' . $tag . ' : ' . $reason );
2415
        $notProcessedCount++;
2848
        $notProcessedCount++;
2416
    }
2849
    }
2417
 
2850
 
2418
    foreach my $entry ( keys(%versions) )
2851
    foreach my $entry ( keys(%versions) )
2419
    {
2852
    {
Line 2422... Line 2855...
2422
        $inernalErrorCount++;
2855
        $inernalErrorCount++;
2423
    }
2856
    }
2424
 
2857
 
2425
    if ( $adjustedPath || 1 )
2858
    if ( $adjustedPath || 1 )
2426
    {
2859
    {
2427
        Information ("Package Paths");
2860
        Information ("Package Info: Files, Removed, Added, Version, ViewPath");
2428
        foreach my $entry ( @processOrder )
2861
        foreach my $entry ( @processOrder )
2429
        {
2862
        {
2430
            my $viewPath = $versions{$entry}{data}{ViewPath} || '';
2863
            my $viewPath = $versions{$entry}{data}{ViewPath} || '';
-
 
2864
            Information (sprintf "%4s, %4s, %4s, %20s : %s",
-
 
2865
                        $versions{$entry}{data}{fileCount} || '-',
-
 
2866
                        $versions{$entry}{data}{filesRemoved} || '-',
-
 
2867
                        $versions{$entry}{data}{filesAdded} || '-',
2431
            Information (sprintf "ViewPath: %20s : %s", GetVname($entry), $viewPath);
2868
                        GetVname($entry), $viewPath);
2432
        }
2869
        }
2433
    }
2870
    }
2434
 
2871
 
2435
    Message ("Packages processed: $processedCount");
2872
    Message ("Packages processed: $processedCount");
2436
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
2873
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
2437
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
2874
    Warning ("Internal Errors: $inernalErrorCount") if ( $inernalErrorCount );
-
 
2875
    Warning ("Multiple source paths", @multiplePaths ) if ( scalar @multiplePaths > 1 );
2438
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
2876
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
2439
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
2877
    Warning ("Packages with Bad Paths: $badPathCount") if ( $badPathCount );
2440
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
2878
    Warning ("Packages with Bad ProjectBase: $badProjectBaseCount") if ( $badProjectBaseCount );
2441
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
2879
    Warning ("Packages with MakeProjects: $badMakeProjectCount") if ( $badMakeProjectCount );
2442
    Warning ("Global Error Detected") if ( $globalError );
2880
    Warning ("Global Error Detected") if ( $globalError );
2443
    Message ("All Done");
2881
    Message ("---- All Done -----");
2444
}
2882
}
2445
 
2883
 
2446
#-------------------------------------------------------------------------------
2884
#-------------------------------------------------------------------------------
2447
# Function        : extractFilesFromClearCase
2885
# Function        : extractFilesFromClearCase
2448
#
2886
#
Line 2463... Line 2901...
2463
{
2901
{
2464
    my ($data, $cc_path, $cc_label) = @_;
2902
    my ($data, $cc_path, $cc_label) = @_;
2465
    my $tryCount = 0;
2903
    my $tryCount = 0;
2466
    my $rv = 99;
2904
    my $rv = 99;
2467
 
2905
 
2468
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
2906
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
2469
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2907
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2470
    
2908
    
2471
    if ( $opt_preserveProjectBase )
2909
    if ( $opt_preserveProjectBase && !$opt_forceProjectBase )
2472
    {
2910
    {
2473
        my $cc_vob = $cc_path;
2911
        my $cc_vob = $cc_path;
2474
        $cc_vob =~ s~^/~~;
2912
        $cc_vob =~ s~^/~~;
2475
        $cc_vob =~ s~/.*~~;
2913
        $cc_vob =~ s~/.*~~;
2476
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
2914
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
Line 2484... Line 2922...
2484
        return 0;
2922
        return 0;
2485
    }
2923
    }
2486
 
2924
 
2487
    while ( $rv == 99 ) {
2925
    while ( $rv == 99 ) {
2488
        my @args;
2926
        my @args;
2489
        push (@args, '-view', $opt_name ) if ( defined $opt_name );
2927
        push (@args, '-view', $opt_name ) if ( defined $opt_name && ! defined $opt_mergePackages );
2490
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2928
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2491
                    "-label=$cc_label" ,
2929
                    "-label=$cc_label" ,
2492
                    "-path=$cc_path",
2930
                    "-path=$cc_path",
2493
                    @args
2931
                    @args
2494
                    );
2932
                    );
Line 2708... Line 3146...
2708
                    #
3146
                    #
2709
                    my @myArgs;
3147
                    my @myArgs;
2710
                    my $myProjectDir;
3148
                    my $myProjectDir;
2711
                    my $myProject = "$data->{ViewRoot}/$file";
3149
                    my $myProject = "$data->{ViewRoot}/$file";
2712
                    $myProject =~ s~/[^/]+$~~;
3150
                    $myProject =~ s~/[^/]+$~~;
-
 
3151
 
2713
                    $line =~ s~MakeProject~push \@myArgs,~;
3152
                    unless ($line =~ m~\s*(\w+)\s*\((.*)\)\s*;\s*$~ )
2714
                    eval $line;
3153
                    {
2715
                    Error("Line did not compiler: $line", "Err: $@" ) if ($@);
3154
                        Error("Could not detect arguments: $line");
-
 
3155
                    }
-
 
3156
                    my $args = $2;
-
 
3157
                    $args =~ tr~'" ~ ~s;
-
 
3158
                    @myArgs = split (/\s*,\s*/, $args);
2716
                    shift @myArgs;
3159
                    shift @myArgs;
2717
                    foreach ( @myArgs )
3160
                    foreach ( @myArgs )
2718
                    {
3161
                    {
2719
                        next if ( m~^--~ );
3162
                        next if ( m~^--~ );
2720
                        $myProject .= '/' . $_;
3163
                        $myProject .= '/' . $_;
Line 2898... Line 3341...
2898
                    #
3341
                    #
2899
                    my @myArgs;
3342
                    my @myArgs;
2900
                    my $myProjectDir;
3343
                    my $myProjectDir;
2901
                    my $myProject = "$data->{ViewRoot}/$file";
3344
                    my $myProject = "$data->{ViewRoot}/$file";
2902
                    $myProject =~ s~/[^/]+$~~;
3345
                    $myProject =~ s~/[^/]+$~~;
-
 
3346
 
2903
                    $line =~ s~.*\(~push \@myArgs, (~;
3347
                    unless ($line =~ m~\s*(\w+)\s*\((.*)\)\s*;\s*$~ )
2904
                    eval $line;
3348
                    {
2905
                    Error("Line did not compiler: $line", "Err: $@" ) if ($@);
3349
                        Error("Could not detect arguments: $line");
-
 
3350
                    }
-
 
3351
                    my $args = $2;
-
 
3352
                    $args =~ tr~'" ~ ~s;
-
 
3353
                    @myArgs = split (/\s*,\s*/, $args);
2906
                    shift @myArgs;
3354
                    shift @myArgs;
2907
                    foreach ( @myArgs )
3355
                    foreach ( @myArgs )
2908
                    {
3356
                    {
2909
                        next if ( m~^--~ );
3357
                        next if ( m~^--~ );
2910
                        next unless ( m~^\.\./~ );
3358
                        next unless ( m~^\.\./~ );
Line 3438... Line 3886...
3438
                    $versions{$pv_id}{version} = $version;
3886
                    $versions{$pv_id}{version} = $version;
3439
                    $versions{$pv_id}{buildVersion} = $buildVersion;
3887
                    $versions{$pv_id}{buildVersion} = $buildVersion;
3440
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
3888
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
3441
 
3889
 
3442
                    #
3890
                    #
3443
                    #   New methof for detecting a ripple
3891
                    #   New method for detecting a ripple
3444
                    #       Don't look at the version number
3892
                    #       Don't look at the version number
3445
                    #       Use RM data
3893
                    #       Use RM data
3446
                    #       Inlude the comment - there are some cases where the comment
3894
                    #       Inlude the comment - there are some cases where the comment
3447
                    #       appears to have been user modified.
3895
                    #       appears to have been user modified.
3448
                    #
3896
                    #
Line 3709... Line 4157...
3709
# Returns         : Cleaned up vcs tag
4157
# Returns         : Cleaned up vcs tag
3710
#
4158
#
3711
sub vcsCleanup
4159
sub vcsCleanup
3712
{
4160
{
3713
    my ($tag) = @_;
4161
    my ($tag) = @_;
3714
    $tag =~ tr~\\/~/~;
4162
    $tag =~ tr~\\/~/~;                              # Force use of /
-
 
4163
    $tag =~ s~/+$~~;                                # Trailing /
3715
    if ( $tag =~ m~^CC::~ )
4164
    if ( $tag =~ m~^CC::~ )
3716
    {
4165
    {
-
 
4166
        $tag =~ s~CC::/VOB:/~CC::/~;                # Kill stuff
3717
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
4167
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
3718
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
4168
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
3719
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
4169
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
3720
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
4170
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
3721
        $tag =~ s~/build.pl::~::~i;
4171
        $tag =~ s~/build.pl::~::~i;
Line 3765... Line 4215...
3765
        $bad = 1 if ( $path =~ m~^/devl/~ || $path  =~ m~^devl/~ );
4215
        $bad = 1 if ( $path =~ m~^/devl/~ || $path  =~ m~^devl/~ );
3766
        $bad = 1 if ( $path =~ m~^CVS~ );
4216
        $bad = 1 if ( $path =~ m~^CVS~ );
3767
        $bad = 1 if ( $path =~ m~^http:~i );
4217
        $bad = 1 if ( $path =~ m~^http:~i );
3768
        $bad = 1 if ( $path =~ m~^[A-Za-z]\:~ );
4218
        $bad = 1 if ( $path =~ m~^[A-Za-z]\:~ );
3769
        $bad = 1 if ( $path =~ m~^//~ );
4219
        $bad = 1 if ( $path =~ m~^//~ );
-
 
4220
        $bad = 1 if ( $path =~ m~^/blade1/~ );
-
 
4221
        $bad = 1 if ( $path =~ m~^/devl/~ );
3770
        $bad = 1 if ( $path =~ m~^/*none~i );
4222
        $bad = 1 if ( $path =~ m~^/*none~i );
3771
        $bad = 1 if ( $path =~ m~^/*NoWhere~i );
4223
        $bad = 1 if ( $path =~ m~^/*NoWhere~i );
3772
        $bad = 1 if ( $path =~ m~^-$~i );
4224
        $bad = 1 if ( $path =~ m~^-$~i );
3773
        $bad = 1 if ( $path =~ m~^cvsserver:~ );
4225
        $bad = 1 if ( $path =~ m~^cvsserver:~ );
3774
        $bad = 1 if ( $path =~ m~,\s*module:~ );
4226
        $bad = 1 if ( $path =~ m~,\s*module:~ );
-
 
4227
        $bad = 1 if ( $path =~ m~[()]~ );
3775
#        $bad = 1 unless ( $path =~ m~^/~ );
4228
#        $bad = 1 unless ( $path =~ m~^/~ );
3776
    }
4229
    }
3777
    else
4230
    else
3778
    {
4231
    {
3779
        $bad = 1;
4232
        $bad = 1;
Line 4218... Line 4671...
4218
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4671
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4219
        if (exists $ScmRepoMap{$packageNames});
4672
        if (exists $ScmRepoMap{$packageNames});
4220
 
4673
 
4221
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4674
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4222
        if (exists $ScmRepoMap{$packageNames}{protected});
4675
        if (exists $ScmRepoMap{$packageNames}{protected});
4223
 
-
 
4224
    #
4676
    #
4225
    #   Free the memory
4677
    #   Free the memory
4226
    #
4678
    #
4227
    %ScmRepoMap = ();
4679
    %ScmRepoMap = ();
4228
 
4680
 
Line 4231... Line 4683...
4231
    #
4683
    #
4232
    Warning ("No VOB Mapping found")
4684
    Warning ("No VOB Mapping found")
4233
        unless ($opt_vobMap);
4685
        unless ($opt_vobMap);
4234
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4686
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4235
        unless ( $opt_repo || $opt_vobMap );
4687
        unless ( $opt_repo || $opt_vobMap );
4236
 
-
 
4237
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '');
4688
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
-
 
4689
    $r1 =~ s~//~/~g;
4238
    $r1 =~ s~^/~~;
4690
    $r1 =~ s~^/~~;
4239
    $r1 =~ s~/$~~;
4691
    $r1 =~ s~/$~~;
4240
    $svnRepo = $opt_repo_base . $r1;
4692
    $svnRepo = $opt_repo_base . $r1;
4241
 
4693
 
4242
    Verbose( "Repo URL: $svnRepo");
4694
    Verbose( "Repo URL: $svnRepo");
Line 4333... Line 4785...
4333
        my $vcsType = $1;
4785
        my $vcsType = $1;
4334
        my $cc_label = $4;
4786
        my $cc_label = $4;
4335
        my $cc_path = $2;
4787
        my $cc_path = $2;
4336
        $cc_path = '/' . $cc_path;
4788
        $cc_path = '/' . $cc_path;
4337
        $cc_path =~ tr~\\/~/~s;
4789
        $cc_path =~ tr~\\/~/~s;
-
 
4790
        $cc_path =~ s~/+$~~;
4338
 
4791
 
4339
        $VobPaths{$cc_path}++;
4792
        $VobPaths{$cc_path}++;
4340
    }
4793
    }
4341
 
4794
 
4342
    @multiplePaths = sort keys %VobPaths;
4795
    @multiplePaths = sort keys %VobPaths;
4343
    if ( scalar @multiplePaths > 1 )
4796
    if ( scalar @multiplePaths > 1 )
4344
    {
4797
    {
4345
        Warning ("Multiple Paths:" . $_ ) foreach (@multiplePaths);
4798
        Warning ("Multiple Paths:" . $_ ) foreach (@multiplePaths);
-
 
4799
 
-
 
4800
        # Kill SVN import
-
 
4801
        # User will need to configure one path
-
 
4802
        unless ( $opt_AllowMuliplePaths )
-
 
4803
        {
-
 
4804
            Warning ("Multiple Paths detected: Import supressed");
-
 
4805
            $opt_useSvn = 0
-
 
4806
        }
-
 
4807
        else
-
 
4808
        {
-
 
4809
            Message ("Multiple Paths detected: Allowed");
-
 
4810
        }
4346
    }
4811
    }
4347
}
4812
}
4348
 
4813
 
4349
sub isSet
4814
sub isSet
4350
{
4815
{
Line 4570... Line 5035...
4570
    #   Close out the file
5035
    #   Close out the file
4571
    #
5036
    #
4572
    $fh->Close();
5037
    $fh->Close();
4573
}
5038
}
4574
 
5039
 
-
 
5040
#-------------------------------------------------------------------------------
-
 
5041
# Function        : restoreData
-
 
5042
#
-
 
5043
# Description     : Read in essential information
-
 
5044
#                   Used during a resume operation
-
 
5045
#
-
 
5046
# Inputs          : 
-
 
5047
#
-
 
5048
# Returns         : 
-
 
5049
#
-
 
5050
our %ScmVersions;
-
 
5051
sub restoreData
-
 
5052
{
-
 
5053
    my $file = $cwd . "/${packageNames}.data";
-
 
5054
    Message ("Restoring: $file");
-
 
5055
    Error "Cannot locate restoration file: $file" unless ( -f $file );
-
 
5056
    require $file;
-
 
5057
 
-
 
5058
    Error "Resume Data in $file is not valid\n"
-
 
5059
        unless ( keys(%ScmVersions) >= 0 );
-
 
5060
 
-
 
5061
    foreach  ( keys %ScmVersions )
-
 
5062
    {
-
 
5063
        $restoreData{$_} = $ScmVersions{$_}{data};
-
 
5064
        $restoreData{$_}{rmRef} = $ScmVersions{$_}{rmRef};
-
 
5065
    }
-
 
5066
    %ScmVersions = ();
-
 
5067
}
-
 
5068
 
-
 
5069
#-------------------------------------------------------------------------------
-
 
5070
# Function        : testSvnLabel
-
 
5071
#
-
 
5072
# Description     : Test existence of an SVN label
-
 
5073
#
-
 
5074
# Inputs          :     Package
-
 
5075
#                       Label to test
-
 
5076
#
-
 
5077
# Returns         : 0   - Tag in place
-
 
5078
#                   1   - Not in place
-
 
5079
#
-
 
5080
sub testSvnLabel
-
 
5081
{
-
 
5082
    my ($svnPkg, $svnTag) = @_;
-
 
5083
 
-
 
5084
    my $rv = JatsToolPrint ( 'jats_svnlabel',
-
 
5085
                    '-check',
-
 
5086
                    "-packagebase=$svnPkg",
-
 
5087
                    "$svnTag",
-
 
5088
                     );
-
 
5089
    Message ("testSvnLabel: $svnTag - $rv");
-
 
5090
    return $rv;
-
 
5091
}
-
 
5092
 
4575
 
5093
 
4576
#-------------------------------------------------------------------------------
5094
#-------------------------------------------------------------------------------
4577
#   Documentation
5095
#   Documentation
4578
#
5096
#
4579
 
5097