Subversion Repositories DevTools

Rev

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

Rev 2489 Rev 2548
Line 69... Line 69...
69
my $opt_vobMap;
69
my $opt_vobMap;
70
my $opt_preserveProjectBase;
70
my $opt_preserveProjectBase;
71
my $opt_ignoreProjectBaseErrors;
71
my $opt_ignoreProjectBaseErrors;
72
my $opt_ignoreMakeProjectErrors;
72
my $opt_ignoreMakeProjectErrors;
73
my $opt_forceProjectBase;
73
my $opt_forceProjectBase;
-
 
74
my $opt_limitProjectBase;
74
my $opt_ignoreBadPaths;
75
my $opt_ignoreBadPaths;
75
my $opt_delete;
76
my $opt_delete;
76
my $opt_recentAge = 14;             # Days
77
my $opt_recentAge = 14;             # Days
77
my $opt_relabel = 0;
78
my $opt_relabel = 0;
78
my $opt_protected;
79
my $opt_protected;
79
my $opt_useSvn = 1;
80
my $opt_useSvn = 1;
80
my $opt_testRmDatabase;
81
my $opt_testRmDatabase;
81
my $opt_extractFromSvn;
82
my $opt_extractFromSvn;
-
 
83
my $opt_AllowMuliplePaths;
-
 
84
my $opt_resume;
82
 
85
 
83
################################################################################
86
################################################################################
84
#   List of Projects Suffixes and Branch Names to be used within SVN
87
#   List of Projects Suffixes and Branch Names to be used within SVN
85
#
88
#
86
#       Name        - Name of branch for the project
89
#       Name        - Name of branch for the project
Line 151... Line 154...
151
    'db_cda'              => ',utf8,',
154
    'db_cda'              => ',utf8,',
152
    'CommandServer'       => ',IgnoreMakeProject,',
155
    'CommandServer'       => ',IgnoreMakeProject,',
153
    'TDSExporterControl'  => ',IgnoreMakeProject,',
156
    'TDSExporterControl'  => ',IgnoreMakeProject,',
154
    'cdagui'              => ',IgnoreMakeProject,',
157
    'cdagui'              => ',IgnoreMakeProject,',
155
 
158
 
-
 
159
 
-
 
160
    'ftp'                   => ',SetProjectBase,',
-
 
161
    'ddu_app_manager'       => ',SetProjectBase,IgnoreMakeProject,',
-
 
162
    'ddu_afc'               => ',SetProjectBase,IgnoreMakeProject,',
-
 
163
    'ddu_dog'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
164
    'ddu_management'        => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,',
156
    'daf_bvt'                 => ',IgnoreMakeProject,',  # Look OK
165
    'ddu_fim'               => ',IgnoreMakeProject,',
-
 
166
    'ddu_mccain'            => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
167
    'ddu_mon'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle,',
-
 
168
    'ddu_rcu'               => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode,',
-
 
169
    'ddu_status_logging'    => ',SetProjectBase,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode/projects/seattle,',
-
 
170
    'ddu_logging_lib'       => ',SetProjectBase,ForceProjectBase=/DPG_SWCode/projects/seattle/ddu,',
-
 
171
    'verifone'              => ',ForceProjectBase=/DPG_SWCode/products/verifone,',
-
 
172
    'dm_devcdfile'          => 'AllowMultiPath',
-
 
173
    'daf_ct_mcr_unified'    => 'AllowMultiPath',
-
 
174
    'cst-rms-db'            => 'AllowMultiPath',
-
 
175
    'daf_common'            => 'IgnoreProjectBase',
-
 
176
    'devcd'                 => 'AllowMultiPath',
157
    'daf_dll'                 => ',IgnoreMakeProject,',  # MakeProject not in used makefile
177
    'daf_dll'                   => 'AllowMultiPath,IgnoreMakeProject',  # MakeProject not in used makefile
-
 
178
    'daf_transap_proxyman_edf'  => 'AllowMultiPath,IgnoreProjectBase',
-
 
179
    'devrelease'                => 'AllowMultiPath',
-
 
180
 
-
 
181
    'dm_devrelease'             => 'AllowMultiPath',
-
 
182
    'dm_rtswis'                 => 'AllowMultiPath',
-
 
183
    'dm_devcd'                  => 'AllowMultiPath',
-
 
184
    'dm_documentation'          => 'AllowMultiPath,IgnoreBadPath',
-
 
185
    'dm_eventhdr'               => 'AllowMultiPath',
-
 
186
    'dm_javaenums'              => 'AllowMultiPath',
-
 
187
    'dm_solidbasetypes'         => 'AllowMultiPath',
-
 
188
    'dm_swismetadata'           => 'AllowMultiPath',
-
 
189
    'dm_cuttables'              => 'AllowMultiPath',
-
 
190
    'dm_devudapi'               => 'AllowMultiPath',
-
 
191
    'buscdapi'                  => 'AllowMultiPath',
158
    'PFTPi'                   => ',IgnoreMakeProject,',  # Looks OK
192
    'daf_bvt'                   => 'AllowMultiPath,IgnoreMakeProject,',  # Look OK
-
 
193
    'daf_cd_transap'            => 'AllowMultiPath,IgnoreBadPath,IgnoreProjectBase',
-
 
194
    'cdref'                     => 'AllowMultiPath',
-
 
195
    'dm_sysbasetypes'           => 'AllowMultiPath',
-
 
196
    'dm_sysswis'                => 'AllowMultiPath',
-
 
197
    'dm_syscd'                  => 'AllowMultiPath',
-
 
198
    'dm_udtypes'                => 'AllowMultiPath',
-
 
199
    'dm_systemcdtables'         => 'AllowMultiPath',
-
 
200
    'dm_utils'                  => 'AllowMultiPath',
-
 
201
    'dm_udxml'                  => 'AllowMultiPath',
-
 
202
    'HCP5000_resources'         => 'AllowMultiPath',
-
 
203
    'massrtswis'                => 'AllowMultiPath',
-
 
204
    'pcp5000'                   => 'AllowMultiPath,ForceProjectBase=/DPG_SWCode',
-
 
205
    'PFTPi'                   => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',  # Looks OK
159
    'PFTPu'                   => ',IgnoreMakeProject,',  # Looks OK
206
    'PFTPu'                   => 'AllowMultiPath,IgnoreMakeProject,ForceProjectBase=/DPG_SWCode',  # Looks OK
160
    'WinCEBlocker'            => ',IgnoreMakeProject,',  # Looks OK
207
    'WinCEBlocker'            => ',IgnoreMakeProject,',  # Looks OK
161
    'WinCEDeviceAutoInject'   => ',IgnoreMakeProject,',  # Looks OK
208
    'WinCEDeviceAutoInject'   => ',IgnoreMakeProject,',  # Looks OK
162
    'WinCEReboot'             => ',IgnoreMakeProject,',  # Looks OK
209
    'WinCEReboot'             => ',IgnoreMakeProject,',  # Looks OK
-
 
210
    'rsmaint'                 => 'AllowMultiPath',
-
 
211
    'sysbasetypes'            => 'AllowMultiPath',
-
 
212
    'syscd'                   => 'AllowMultiPath',
-
 
213
    'sysswis'                 => 'AllowMultiPath',
-
 
214
    'udserialiser'                 => 'AllowMultiPath',
-
 
215
    'systemcdtables'          => 'AllowMultiPath',
-
 
216
    'udxml'          => 'AllowMultiPath',
-
 
217
    
163
 
218
 
164
 
219
 
165
    'ftp'                   => ',SetProjectBase,',
-
 
166
    'ddu_app_manager'       => ',SetProjectBase,IgnoreMakeProject,',
-
 
167
    'ddu_afc'               => ',SetProjectBase,IgnoreMakeProject,',
220
    'daf_ct_mcr_14443'          => 'LimitProjectBase=/DPG_SWBase/ct',
168
    'ddu_dog'               => ',SetProjectBase,IgnoreMakeProject,',
-
 
169
 
221
 
170
    'icl'                   => 'IgnoreProjectBase,',
222
    'icl'                   => 'IgnoreProjectBase,',
171
    'itso'                  => 'IgnoreProjectBase,',
223
    'itso'                  => 'IgnoreProjectBase,',
172
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
224
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
173
    'daf_utils_mos'         => 'IgnoreProjectBase,',
225
    'daf_utils_mos'         => 'IgnoreProjectBase,',
Line 257... Line 309...
257
my $processTotal = 0;
309
my $processTotal = 0;
258
my $recentCount = 0;
310
my $recentCount = 0;
259
my $packageReLabelCount = 0;
311
my $packageReLabelCount = 0;
260
my %saneLabels;
312
my %saneLabels;
261
my $adjustedPath = 0;
313
my $adjustedPath = 0;
-
 
314
my $forceImportFlush = 0;
-
 
315
my %restoreData;
262
 
316
 
263
our $GBE_RM_URL;
317
our $GBE_RM_URL;
264
my $UNIX = $ENV{'GBE_UNIX'};
318
my $UNIX = $ENV{'GBE_UNIX'};
265
 
319
 
266
my $result = GetOptions (
320
my $result = GetOptions (
267
                "help+"         => \$opt_help,          # flag, multiple use allowed
321
                "help+"             => \$opt_help,          # flag, multiple use allowed
268
                "manual:3"      => \$opt_help,
322
                "manual:3"          => \$opt_help,
269
                "verbose:+"     => \$opt_verbose,       # Versose
323
                "verbose:+"         => \$opt_verbose,       # Versose
270
                "repository:s"  => \$opt_repo,          # Name of repository
324
                "repository:s"      => \$opt_repo,          # Name of repository
271
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
325
                'rbase:s'           => \$opt_repo_base,     # Base of the repo
272
                "flat!"         => \$opt_flat,          # Flat structure
326
                "flat!"             => \$opt_flat,          # Flat structure
273
                "test!"         => \$opt_test,          # Test operations
327
                "test!"             => \$opt_test,          # Test operations
274
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
328
                "reuse!"            => \$opt_reuse,         # Reuse ClearCase views
275
                "age:i"         => \$opt_age,           # Only recent versions
329
                "age:i"             => \$opt_age,           # Only recent versions
276
                "dump:1"        => \$opt_dump,          # Dump Data
330
                "dump:1"            => \$opt_dump,          # Dump Data
277
                "images:1"      => \$opt_images,        # Create DOT images
331
                "images:1"          => \$opt_images,        # Create DOT images
278
                "retain:i"      => \$opt_retaincount,   # Retain N packages
332
                "retain:i"          => \$opt_retaincount,   # Retain N packages
279
                "pruneMode:s"   => \$opt_pruneModeString,
333
                "pruneMode:s"       => \$opt_pruneModeString,
280
                "listtags:i"    => \$opt_listTags,
334
                "listtags:i"        => \$opt_listTags,
281
                "name:s"        => \$opt_name,          # Alternate output
335
                "name:s"            => \$opt_name,          # Alternate output
282
                "tip:s"         => \@opt_tip,           # Force tip version(s)
336
                "tip:s"             => \@opt_tip,           # Force tip version(s)
283
                "log!"          => \$opt_log,
337
                "log!"              => \$opt_log,
284
                "delete!"       => \$opt_delete,
338
                "delete!"           => \$opt_delete,
285
                "postimage!"    => \$opt_postimage,
339
                "postimage!"        => \$opt_postimage,
286
                'workdir:s'     => \$opt_workDir,
340
                'workdir:s'         => \$opt_workDir,
287
                'relabel!'      => \$opt_relabel,
341
                'relabel!'          => \$opt_relabel,
288
                'svn!'          => \$opt_useSvn,
342
                'svn!'              => \$opt_useSvn,
289
                'testRmDatabase'    => \$opt_testRmDatabase,
343
                'testRmDatabase'    => \$opt_testRmDatabase,
290
                'fromSvn!'          => \$opt_extractFromSvn,
344
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
345
                'resume'            => \$opt_resume,
291
                );
346
                );
292
 
347
 
293
#
348
#
294
#   Process help and manual options
349
#   Process help and manual options
295
#
350
#
Line 387... Line 442...
387
smartPackageType();                 # Determine special prune mode
442
smartPackageType();                 # Determine special prune mode
388
ReportPathVariance();
443
ReportPathVariance();
389
massageData();
444
massageData();
390
getSvnData();
445
getSvnData();
391
smartPackageType();                 # Have another go
446
smartPackageType();                 # Have another go
-
 
447
restoreData() if ( $opt_resume );
392
 
448
 
393
my @missedTips = keys %tipVersions;
449
my @missedTips = keys %tipVersions;
394
Error ("Specified tip version not found: @missedTips") if ( @missedTips );
450
Error ("Specified tip version not found: @missedTips") if ( @missedTips );
395
 
451
 
396
if ( $opt_flat )
452
if ( $opt_flat )
Line 632... Line 688...
632
      $opt_flat = 1 unless defined $opt_flat;
688
      $opt_flat = 1 unless defined $opt_flat;
633
    }
689
    }
634
 
690
 
635
    if ( exists $specialPackages{$packageNames[0]} )
691
    if ( exists $specialPackages{$packageNames[0]} )
636
    {
692
    {
637
        my $data = $specialPackages{$packageNames[0]};
693
        my $data = ',' . $specialPackages{$packageNames[0]} . ',';
-
 
694
 
638
        if ( index( $data, ',all' ) >= 0) {
695
        if ( index( $data, ',all' ) >= 0) {
639
            setPruneMode('none') unless (defined $opt_pruneModeString);
696
            setPruneMode('none') unless (defined $opt_pruneModeString);
640
        }
697
        }
641
        
698
        
642
        if ( index( $data, 'protected,' ) >= 0) {
699
        if ( index( $data, 'protected,' ) >= 0) {
Line 651... Line 708...
651
            $opt_preserveProjectBase = 1;
708
            $opt_preserveProjectBase = 1;
652
            $opt_ignoreProjectBaseErrors = 1;
709
            $opt_ignoreProjectBaseErrors = 1;
653
            Message ("Preserving ProjectBase");
710
            Message ("Preserving ProjectBase");
654
        }
711
        }
655
 
712
 
-
 
713
        if ( index( $data, 'AllowMultiPath,' ) >= 0) {
-
 
714
            $opt_AllowMuliplePaths = 1;
-
 
715
            Message ("Allowing Multiple Paths");
-
 
716
        }
-
 
717
 
-
 
718
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
-
 
719
            $opt_forceProjectBase = $1;
-
 
720
            $opt_AllowMuliplePaths = 1;
-
 
721
            Message ("Force Project Base: $opt_forceProjectBase");
-
 
722
        }
-
 
723
 
-
 
724
        if ( $data =~ m~,LimitProjectBase=(.*),~ ) {
-
 
725
            $opt_limitProjectBase = $1;
-
 
726
            $opt_AllowMuliplePaths = 1;
-
 
727
            Message ("Limit Project Base: $opt_forceProjectBase");
-
 
728
        }
-
 
729
        
-
 
730
 
656
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
731
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
657
            $opt_ignoreProjectBaseErrors = 1;
732
            $opt_ignoreProjectBaseErrors = 1;
658
            Message ("Ignore ProjectBase Errors");
733
            Message ("Ignore ProjectBase Errors");
659
        }
734
        }
660
 
735
 
Line 663... Line 738...
663
            Message ("Ignore MakeProject Usage");
738
            Message ("Ignore MakeProject Usage");
664
        }
739
        }
665
 
740
 
666
        if ( index( $data, 'IgnoreBadPath,' ) >= 0) {
741
        if ( index( $data, 'IgnoreBadPath,' ) >= 0) {
667
            $opt_ignoreBadPaths = 1;
742
            $opt_ignoreBadPaths = 1;
668
            Message ("Ignore Bad Paths in makefilest Usage");
743
            Message ("Ignore Bad Paths in makefile Usage");
669
        }
744
        }
670
        
745
        
671
        if ( index( $data, 'utf8,' ) >= 0) {
746
        if ( index( $data, 'utf8,' ) >= 0) {
672
            $mustConvertFileNames = 1;
747
            $mustConvertFileNames = 1;
673
            Message ("Convert filenames to UTF8");
748
            Message ("Convert filenames to UTF8");
Line 1607... Line 1682...
1607
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1682
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1608
 
1683
 
1609
    #
1684
    #
1610
    #   Sava data
1685
    #   Sava data
1611
    #
1686
    #
-
 
1687
    if ( $rv != 6 )
-
 
1688
    {
1612
    $data{errFlags} = $flags;
1689
        $data{errFlags} = $flags;
1613
    $data{duration} = $duration;
1690
        $data{duration} = $duration;
-
 
1691
    }
1614
    $versions{$entry}{rmRef} = $data{rmRef};
1692
    $versions{$entry}{rmRef} = $data{rmRef};
1615
    delete $data{rmRef};
1693
    delete $data{rmRef};
1616
    delete $data{tag};
1694
    delete $data{tag};
1617
    ##delete $data{ViewRoot};
1695
    ##delete $data{ViewRoot};
1618
    $versions{$entry}{data} = \%data;
1696
    $versions{$entry}{data} = \%data;
Line 1682... Line 1760...
1682
#                                   No Files in the extracted view after labeling dirs
1760
#                                   No Files in the extracted view after labeling dirs
1683
#                               3 - Deadwood
1761
#                               3 - Deadwood
1684
#                               4 - Bad usage of ProjectBase detected
1762
#                               4 - Bad usage of ProjectBase detected
1685
#                                   Use of MakeProject detected
1763
#                                   Use of MakeProject detected
1686
#                               5  - Subversion Import disabled
1764
#                               5  - Subversion Import disabled
-
 
1765
#                               6  - Restored via resume
1687
#                       >10 - Fatal error
1766
#                       >10 - Fatal error
1688
#
1767
#
1689
sub newPackageVersionBody
1768
sub newPackageVersionBody
1690
{
1769
{
1691
    my ($data, $entry) = @_;
1770
    my ($data, $entry) = @_;
Line 1709... Line 1788...
1709
    SystemConfig ('ExitOnError' => 0);
1788
    SystemConfig ('ExitOnError' => 0);
1710
 
1789
 
1711
    push @processOrder, $entry;
1790
    push @processOrder, $entry;
1712
    return 0 if ( $opt_test );
1791
    return 0 if ( $opt_test );
1713
 
1792
 
-
 
1793
    #
-
 
1794
    #   Calculate the label for the target package
-
 
1795
    #   Use format <packageName>_<PackageVersion>
-
 
1796
    #   Need to handle WIPs too.
-
 
1797
    #
-
 
1798
    my $import_label = saneLabel($entry);
-
 
1799
 
-
 
1800
    #
-
 
1801
    #   If resuming - then test existence
-
 
1802
    #
-
 
1803
    if ( $opt_resume )
-
 
1804
    {
-
 
1805
        if ( exists $restoreData{$entry}  )
-
 
1806
        {
-
 
1807
 
-
 
1808
            #
-
 
1809
            #   May be able to test existence by looking at $versions{$entry}{svnVersion}
-
 
1810
            #   The hard work may have been done
-
 
1811
            #
-
 
1812
            my $isInSvn = 0;
-
 
1813
            if ( exists $versions{$entry}{svnVersion} && $versions{$entry}{svnVersion}  )
-
 
1814
            {
-
 
1815
                $isInSvn = 1;
-
 
1816
            }
-
 
1817
            Message("SvnVersion check: $isInSvn");
-
 
1818
 
-
 
1819
            $rv = testSvnLabel( "$svnRepo/$packageNames", $import_label );
-
 
1820
            unless ( $rv )
-
 
1821
            {
-
 
1822
                Message ("Skip import - resume detected presense");
-
 
1823
                $firstVersionCreated = $entry unless ( $firstVersionCreated );
-
 
1824
                $versions{$entry}{TagCreated} = 2;
-
 
1825
                foreach  ( keys %{$restoreData{$entry}} )
-
 
1826
                {
-
 
1827
                    $data->{$_} = $restoreData{$entry}{$_};
-
 
1828
                }
-
 
1829
                $forceImportFlush = 1;
-
 
1830
DebugDumpData('Data', $data );
-
 
1831
                return 6;
-
 
1832
            }
-
 
1833
        }
-
 
1834
        else
-
 
1835
        {
-
 
1836
            Warning ("Resume data missing");
-
 
1837
        }
-
 
1838
    }
-
 
1839
    
1714
#   Keep DeadWood. May be a WIP
1840
#   Keep DeadWood. May be a WIP
1715
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
1841
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
1716
#    {
1842
#    {
1717
#        $data->{errStr} = 'Package is DeadWood';
1843
#        $data->{errStr} = 'Package is DeadWood';
1718
#        return 3;
1844
#        return 3;
Line 1726... Line 1852...
1726
    {
1852
    {
1727
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
1853
        Warning ("Error: Bad VcsTag for: " . GetVname($entry),
1728
                 "Tag: $data->{tag}" );
1854
                 "Tag: $data->{tag}" );
1729
        $data->{errStr} = 'VCS Tag Marked as Bad';
1855
        $data->{errStr} = 'VCS Tag Marked as Bad';
1730
        return 1;
1856
        return 1;
-
 
1857
 
1731
    }
1858
    }
1732
 
1859
 
1733
 
1860
 
1734
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
1861
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
1735
    $vcs_type = $1;
1862
    $vcs_type = $1;
Line 1762... Line 1889...
1762
        $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
1889
        $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
1763
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
1890
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
1764
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
1891
        $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
1765
        $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
1892
        $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
1766
        $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
1893
        $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
1767
        $cc_path = '/DPG_SWCode/projects/seattle/ddu' if ( $versions{$entry}{name} eq 'ddu_dog');
-
 
1768
 
1894
 
1769
        if (   $versions{$entry}{name} =~ m/^ERGagency$/i
1895
        if (   $versions{$entry}{name} =~ m/^ERGagency$/i
1770
            || $versions{$entry}{name} =~ m/^ERGavm$/i
1896
            || $versions{$entry}{name} =~ m/^ERGavm$/i
1771
            || $versions{$entry}{name} =~ m/^ERGboi$/i
1897
            || $versions{$entry}{name} =~ m/^ERGboi$/i
1772
            || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
1898
            || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
Line 1809... Line 1935...
1809
            {
1935
            {
1810
                $cc_path = '/MREF_Package';
1936
                $cc_path = '/MREF_Package';
1811
            }
1937
            }
1812
        }
1938
        }
1813
 
1939
 
-
 
1940
        $cc_path = $opt_forceProjectBase
-
 
1941
            if ( $opt_forceProjectBase );
-
 
1942
 
-
 
1943
        if ( $opt_limitProjectBase )
-
 
1944
        {
-
 
1945
            if ( $cc_path =~ m~$opt_limitProjectBase~ )
-
 
1946
            {
-
 
1947
                $cc_path = $opt_limitProjectBase;
-
 
1948
            }
-
 
1949
        }
-
 
1950
        
1814
        if ( $cc_path_original ne $cc_path )
1951
        if ( $cc_path_original ne $cc_path )
1815
        {
1952
        {
1816
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
1953
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
1817
        }
1954
        }
1818
    }
1955
    }
Line 1987... Line 2124...
1987
        $data->{errStr} = 'Failed to create Package';
2124
        $data->{errStr} = 'Failed to create Package';
1988
        return 10;
2125
        return 10;
1989
    }
2126
    }
1990
 
2127
 
1991
    #
2128
    #
1992
    #   Calculate the label for the target package
-
 
1993
    #   Use format <packageName>_<PackageVersion>
-
 
1994
    #   Need to handle WIPs too.
-
 
1995
    #
-
 
1996
    my $import_label = saneLabel($entry);
-
 
1997
 
-
 
1998
    #
-
 
1999
    #   May need to create the branchpoint
2129
    #   May need to create the branchpoint
2000
    #   The process is delayed until its needed so avoid creating unneeded
2130
    #   The process is delayed until its needed so avoid creating unneeded
2001
    #   branch points
2131
    #   branch points
2002
    #
2132
    #
2003
    if ( $createBranch )
2133
    if ( $createBranch )
Line 2009... Line 2139...
2009
        {
2139
        {
2010
            $data->{errStr} = 'Failed to create Branch Point';
2140
            $data->{errStr} = 'Failed to create Branch Point';
2011
            return 11;
2141
            return 11;
2012
        }
2142
        }
2013
    }
2143
    }
2014
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
-
 
2015
 
2144
 
-
 
2145
    #
-
 
2146
    #   If we are in resume mode then we MUST kill the import directory
-
 
2147
    #   if we have skipped anything
-
 
2148
    #
-
 
2149
    if ( $forceImportFlush )
-
 
2150
    {
-
 
2151
        $forceImportFlush = 0;
-
 
2152
        RmDirTree ('SvnImportDir');
-
 
2153
    }
-
 
2154
 
-
 
2155
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2016
    my $datafile = "importdata.$import_label.properties";
2156
    my $datafile = "importdata.$import_label.properties";
-
 
2157
 
2017
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2158
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2018
                    "-package=$svnRepo/$packageNames",
2159
                    "-package=$svnRepo/$packageNames",
2019
                    "-dir=$data->{ViewPath}",
2160
                    "-dir=$data->{ViewPath}",
2020
                    "-label=$import_label",
2161
                    "-label=$import_label",
2021
                    "-datafile=$datafile",
2162
                    "-datafile=$datafile",
Line 2036... Line 2177...
2036
    #   Retain entries in a global file
2177
    #   Retain entries in a global file
2037
    #
2178
    #
2038
    if ( -f $datafile  )
2179
    if ( -f $datafile  )
2039
    {
2180
    {
2040
        my $rmData = JatsProperties::New($datafile);
2181
        my $rmData = JatsProperties::New($datafile);
-
 
2182
        if ( $rmData->getProperty('subversion.tag') )
-
 
2183
        {
2041
        $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
2184
            $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
-
 
2185
        }
-
 
2186
        else
-
 
2187
        {
-
 
2188
            Warning ("Property files has no subversion.tag");
-
 
2189
        }
-
 
2190
        $data->{fileCount}    = $rmData->getProperty('files.base', 0);
-
 
2191
        $data->{filesRemoved} = $rmData->getProperty('files.removed',0);
-
 
2192
        $data->{filesAdded}   = $rmData->getProperty('files.added',0);
2042
    }
2193
    }
2043
 
2194
 
2044
    unless ( $data->{rmRef}  )
2195
    unless ( $data->{rmRef}  )
2045
    {
2196
    {
2046
        $data->{errStr} = 'Failed to determine Rm Reference';
2197
        $data->{errStr} = 'Failed to determine Rm Reference';
Line 2177... Line 2328...
2177
    push (@opts, '-author', $author) if ( $author );
2328
    push (@opts, '-author', $author) if ( $author );
2178
    #
2329
    #
2179
    #   Only do once
2330
    #   Only do once
2180
    #
2331
    #
2181
    return unless ( $createPackageDone );
2332
    return unless ( $createPackageDone );
-
 
2333
    return if ( $opt_resume );
2182
    $createPackageDone = 0;
2334
    $createPackageDone = 0;
2183
 
2335
 
2184
    #
2336
    #
2185
    #   Real import
2337
    #   Real import
2186
    #       Do not Delete package if it exists
2338
    #       Do not Delete package if it exists
Line 2342... Line 2494...
2342
    #
2494
    #
2343
    #   Perform the branch
2495
    #   Perform the branch
2344
    #
2496
    #
2345
    if ( defined $src_label )
2497
    if ( defined $src_label )
2346
    {
2498
    {
-
 
2499
        if ( $opt_resume )
-
 
2500
        {
-
 
2501
            my $rv = JatsToolPrint ( 'jats_svnlabel',
-
 
2502
                        '-check',
-
 
2503
                        '-packagebase', "$svnRepo/$packageNames",
-
 
2504
                        '-branch',
-
 
2505
                        $tgt_label );
-
 
2506
            return unless ( $rv );
-
 
2507
        }
-
 
2508
 
2347
        #
2509
        #
2348
        #   The 'clone' operation will backtrack the branch point
2510
        #   The 'clone' operation will backtrack the branch point
2349
        #   to the source of the label. This will make the output version
2511
        #   to the source of the label. This will make the output version
2350
        #   tree much prettier
2512
        #   tree much prettier
2351
        #
2513
        #
Line 2423... Line 2585...
2423
        $inernalErrorCount++;
2585
        $inernalErrorCount++;
2424
    }
2586
    }
2425
 
2587
 
2426
    if ( $adjustedPath || 1 )
2588
    if ( $adjustedPath || 1 )
2427
    {
2589
    {
2428
        Information ("Package Paths");
2590
        Information ("Package Info: Files, Removed, Added, Version, ViewPath");
2429
        foreach my $entry ( @processOrder )
2591
        foreach my $entry ( @processOrder )
2430
        {
2592
        {
2431
            my $viewPath = $versions{$entry}{data}{ViewPath} || '';
2593
            my $viewPath = $versions{$entry}{data}{ViewPath} || '';
-
 
2594
            Information (sprintf "%4s, %4s, %4s, %20s : %s",
-
 
2595
                        $versions{$entry}{data}{fileCount} || '-',
-
 
2596
                        $versions{$entry}{data}{filesRemoved} || '-',
-
 
2597
                        $versions{$entry}{data}{filesAdded} || '-',
2432
            Information (sprintf "ViewPath: %20s : %s", GetVname($entry), $viewPath);
2598
                        GetVname($entry), $viewPath);
2433
        }
2599
        }
2434
    }
2600
    }
2435
 
2601
 
2436
    Message ("Packages processed: $processedCount");
2602
    Message ("Packages processed: $processedCount");
2437
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
2603
    Warning ("Packages not processed: $notProcessedCount") if ( $notProcessedCount );
Line 2467... Line 2633...
2467
    my $rv = 99;
2633
    my $rv = 99;
2468
 
2634
 
2469
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
2635
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
2470
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2636
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2471
    
2637
    
2472
    if ( $opt_preserveProjectBase )
2638
    if ( $opt_preserveProjectBase && !$opt_forceProjectBase )
2473
    {
2639
    {
2474
        my $cc_vob = $cc_path;
2640
        my $cc_vob = $cc_path;
2475
        $cc_vob =~ s~^/~~;
2641
        $cc_vob =~ s~^/~~;
2476
        $cc_vob =~ s~/.*~~;
2642
        $cc_vob =~ s~/.*~~;
2477
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
2643
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
Line 2709... Line 2875...
2709
                    #
2875
                    #
2710
                    my @myArgs;
2876
                    my @myArgs;
2711
                    my $myProjectDir;
2877
                    my $myProjectDir;
2712
                    my $myProject = "$data->{ViewRoot}/$file";
2878
                    my $myProject = "$data->{ViewRoot}/$file";
2713
                    $myProject =~ s~/[^/]+$~~;
2879
                    $myProject =~ s~/[^/]+$~~;
-
 
2880
 
2714
                    $line =~ s~MakeProject~push \@myArgs,~;
2881
                    unless ($line =~ m~\s*(\w+)\s*\((.*)\)\s*;\s*$~ )
2715
                    eval $line;
2882
                    {
2716
                    Error("Line did not compiler: $line", "Err: $@" ) if ($@);
2883
                        Error("Could not detect arguments: $line");
-
 
2884
                    }
-
 
2885
                    my $args = $2;
-
 
2886
                    $args =~ tr~'" ~ ~s;
-
 
2887
                    @myArgs = split (/\s*,\s*/, $args);
2717
                    shift @myArgs;
2888
                    shift @myArgs;
2718
                    foreach ( @myArgs )
2889
                    foreach ( @myArgs )
2719
                    {
2890
                    {
2720
                        next if ( m~^--~ );
2891
                        next if ( m~^--~ );
2721
                        $myProject .= '/' . $_;
2892
                        $myProject .= '/' . $_;
Line 2899... Line 3070...
2899
                    #
3070
                    #
2900
                    my @myArgs;
3071
                    my @myArgs;
2901
                    my $myProjectDir;
3072
                    my $myProjectDir;
2902
                    my $myProject = "$data->{ViewRoot}/$file";
3073
                    my $myProject = "$data->{ViewRoot}/$file";
2903
                    $myProject =~ s~/[^/]+$~~;
3074
                    $myProject =~ s~/[^/]+$~~;
-
 
3075
 
2904
                    $line =~ s~.*\(~push \@myArgs, (~;
3076
                    unless ($line =~ m~\s*(\w+)\s*\((.*)\)\s*;\s*$~ )
2905
                    eval $line;
3077
                    {
2906
                    Error("Line did not compiler: $line", "Err: $@" ) if ($@);
3078
                        Error("Could not detect arguments: $line");
-
 
3079
                    }
-
 
3080
                    my $args = $2;
-
 
3081
                    $args =~ tr~'" ~ ~s;
-
 
3082
                    @myArgs = split (/\s*,\s*/, $args);
2907
                    shift @myArgs;
3083
                    shift @myArgs;
2908
                    foreach ( @myArgs )
3084
                    foreach ( @myArgs )
2909
                    {
3085
                    {
2910
                        next if ( m~^--~ );
3086
                        next if ( m~^--~ );
2911
                        next unless ( m~^\.\./~ );
3087
                        next unless ( m~^\.\./~ );
Line 3710... Line 3886...
3710
# Returns         : Cleaned up vcs tag
3886
# Returns         : Cleaned up vcs tag
3711
#
3887
#
3712
sub vcsCleanup
3888
sub vcsCleanup
3713
{
3889
{
3714
    my ($tag) = @_;
3890
    my ($tag) = @_;
3715
    $tag =~ tr~\\/~/~;
3891
    $tag =~ tr~\\/~/~;                              # Force use of /
-
 
3892
    $tag =~ s~/+$~~;                                # Trailing /
3716
    if ( $tag =~ m~^CC::~ )
3893
    if ( $tag =~ m~^CC::~ )
3717
    {
3894
    {
-
 
3895
        $tag =~ s~CC::/VOB:/~CC::/~;                # Kill stuff
3718
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
3896
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
3719
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
3897
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
3720
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
3898
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
3721
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
3899
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
3722
        $tag =~ s~/build.pl::~::~i;
3900
        $tag =~ s~/build.pl::~::~i;
Line 3766... Line 3944...
3766
        $bad = 1 if ( $path =~ m~^/devl/~ || $path  =~ m~^devl/~ );
3944
        $bad = 1 if ( $path =~ m~^/devl/~ || $path  =~ m~^devl/~ );
3767
        $bad = 1 if ( $path =~ m~^CVS~ );
3945
        $bad = 1 if ( $path =~ m~^CVS~ );
3768
        $bad = 1 if ( $path =~ m~^http:~i );
3946
        $bad = 1 if ( $path =~ m~^http:~i );
3769
        $bad = 1 if ( $path =~ m~^[A-Za-z]\:~ );
3947
        $bad = 1 if ( $path =~ m~^[A-Za-z]\:~ );
3770
        $bad = 1 if ( $path =~ m~^//~ );
3948
        $bad = 1 if ( $path =~ m~^//~ );
-
 
3949
        $bad = 1 if ( $path =~ m~^/blade1/~ );
-
 
3950
        $bad = 1 if ( $path =~ m~^/devl/~ );
3771
        $bad = 1 if ( $path =~ m~^/*none~i );
3951
        $bad = 1 if ( $path =~ m~^/*none~i );
3772
        $bad = 1 if ( $path =~ m~^/*NoWhere~i );
3952
        $bad = 1 if ( $path =~ m~^/*NoWhere~i );
3773
        $bad = 1 if ( $path =~ m~^-$~i );
3953
        $bad = 1 if ( $path =~ m~^-$~i );
3774
        $bad = 1 if ( $path =~ m~^cvsserver:~ );
3954
        $bad = 1 if ( $path =~ m~^cvsserver:~ );
3775
        $bad = 1 if ( $path =~ m~,\s*module:~ );
3955
        $bad = 1 if ( $path =~ m~,\s*module:~ );
-
 
3956
        $bad = 1 if ( $path =~ m~[()]~ );
3776
#        $bad = 1 unless ( $path =~ m~^/~ );
3957
#        $bad = 1 unless ( $path =~ m~^/~ );
3777
    }
3958
    }
3778
    else
3959
    else
3779
    {
3960
    {
3780
        $bad = 1;
3961
        $bad = 1;
Line 4334... Line 4515...
4334
        my $vcsType = $1;
4515
        my $vcsType = $1;
4335
        my $cc_label = $4;
4516
        my $cc_label = $4;
4336
        my $cc_path = $2;
4517
        my $cc_path = $2;
4337
        $cc_path = '/' . $cc_path;
4518
        $cc_path = '/' . $cc_path;
4338
        $cc_path =~ tr~\\/~/~s;
4519
        $cc_path =~ tr~\\/~/~s;
-
 
4520
        $cc_path =~ s~/+$~~;
4339
 
4521
 
4340
        $VobPaths{$cc_path}++;
4522
        $VobPaths{$cc_path}++;
4341
    }
4523
    }
4342
 
4524
 
4343
    @multiplePaths = sort keys %VobPaths;
4525
    @multiplePaths = sort keys %VobPaths;
4344
    if ( scalar @multiplePaths > 1 )
4526
    if ( scalar @multiplePaths > 1 )
4345
    {
4527
    {
4346
        Warning ("Multiple Paths:" . $_ ) foreach (@multiplePaths);
4528
        Warning ("Multiple Paths:" . $_ ) foreach (@multiplePaths);
-
 
4529
 
-
 
4530
        # Kill SVN import
-
 
4531
        # User will need to configure one path
-
 
4532
        unless ( $opt_AllowMuliplePaths )
-
 
4533
        {
-
 
4534
            Warning ("Multiple Paths detected: Import supressed");
-
 
4535
            $opt_useSvn = 0
-
 
4536
        }
-
 
4537
        else
-
 
4538
        {
-
 
4539
            Message ("Multiple Paths detected: Allowed");
-
 
4540
        }
4347
    }
4541
    }
4348
}
4542
}
4349
 
4543
 
4350
sub isSet
4544
sub isSet
4351
{
4545
{
Line 4571... Line 4765...
4571
    #   Close out the file
4765
    #   Close out the file
4572
    #
4766
    #
4573
    $fh->Close();
4767
    $fh->Close();
4574
}
4768
}
4575
 
4769
 
-
 
4770
#-------------------------------------------------------------------------------
-
 
4771
# Function        : restoreData
-
 
4772
#
-
 
4773
# Description     : Read in essential information
-
 
4774
#                   Used during a resume operation
-
 
4775
#
-
 
4776
# Inputs          : 
-
 
4777
#
-
 
4778
# Returns         : 
-
 
4779
#
-
 
4780
our %ScmVersions;
-
 
4781
sub restoreData
-
 
4782
{
-
 
4783
    my $file = $cwd . "/${packageNames}.data";
-
 
4784
    Message ("Restoring: $file");
-
 
4785
    Error "Cannot locate restoration file: $file" unless ( -f $file );
-
 
4786
    require $file;
-
 
4787
 
-
 
4788
    Error "Resume Data in $file is not valid\n"
-
 
4789
        unless ( keys(%ScmVersions) >= 0 );
-
 
4790
 
-
 
4791
    foreach  ( keys %ScmVersions )
-
 
4792
    {
-
 
4793
        $restoreData{$_} = $ScmVersions{$_}{data};
-
 
4794
        $restoreData{$_}{rmRef} = $ScmVersions{$_}{rmRef};
-
 
4795
    }
-
 
4796
    %ScmVersions = ();
-
 
4797
}
-
 
4798
 
-
 
4799
#-------------------------------------------------------------------------------
-
 
4800
# Function        : testSvnLabel
-
 
4801
#
-
 
4802
# Description     : Test existence of an SVN label
-
 
4803
#
-
 
4804
# Inputs          :     Package
-
 
4805
#                       Label to test
-
 
4806
#
-
 
4807
# Returns         : 0   - Tag in place
-
 
4808
#                   1   - Not in place
-
 
4809
#
-
 
4810
sub testSvnLabel
-
 
4811
{
-
 
4812
    my ($svnPkg, $svnTag) = @_;
-
 
4813
 
-
 
4814
    my $rv = JatsToolPrint ( 'jats_svnlabel',
-
 
4815
                    '-check',
-
 
4816
                    "-packagebase=$svnPkg",
-
 
4817
                    "$svnTag",
-
 
4818
                     );
-
 
4819
    Message ("testSvnLabel: $svnTag - $rv");
-
 
4820
    return $rv;
-
 
4821
}
-
 
4822
 
4576
 
4823
 
4577
#-------------------------------------------------------------------------------
4824
#-------------------------------------------------------------------------------
4578
#   Documentation
4825
#   Documentation
4579
#
4826
#
4580
 
4827