Subversion Repositories DevTools

Rev

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

Rev 2429 Rev 2439
Line 31... Line 31...
31
use JatsProperties;
31
use JatsProperties;
32
use JatsEnv;
32
use JatsEnv;
33
use ConfigurationFile;
33
use ConfigurationFile;
34
use JatsSvn qw(:All);
34
use JatsSvn qw(:All);
35
use JatsLocateFiles;
35
use JatsLocateFiles;
-
 
36
use Encode;
36
 
37
 
37
 
38
 
38
#use Data::Dumper;
39
#use Data::Dumper;
39
use Fcntl ':flock'; # import LOCK_* constants
40
use Fcntl ':flock'; # import LOCK_* constants
40
use Cwd;
41
use Cwd;
Line 49... Line 50...
49
my $opt_help = 0;
50
my $opt_help = 0;
50
my $opt_manual = 0;
51
my $opt_manual = 0;
51
my $opt_verbose = 0;
52
my $opt_verbose = 0;
52
my $opt_repo_base = 'AUPERASVN01/';
53
my $opt_repo_base = 'AUPERASVN01/';
53
my $opt_repo = '';
54
my $opt_repo = '';
-
 
55
my $opt_repoSubdir = '';
54
my $opt_flat;
56
my $opt_flat;
55
my $opt_test;
57
my $opt_test;
56
my $opt_reuse;
58
my $opt_reuse;
57
my $opt_age;
59
my $opt_age;
58
my $opt_dump = 0;
60
my $opt_dump = 0;
Line 68... Line 70...
68
my $opt_vobMap;
70
my $opt_vobMap;
69
my $opt_fileList;
71
my $opt_fileList;
70
my $opt_preserveProjectBase;
72
my $opt_preserveProjectBase;
71
my $opt_ignoreProjectBaseErrors;
73
my $opt_ignoreProjectBaseErrors;
72
my $opt_resume;
74
my $opt_resume;
-
 
75
my $opt_ignoreMakeProjectErrors;
73
my $opt_delete;
76
my $opt_delete;
74
my $opt_recentAge = 14;             # Days
77
my $opt_recentAge = 14;             # Days
75
my $opt_relabel = 1;
78
my $opt_relabel = 1;
76
 
79
 
77
################################################################################
80
################################################################################
Line 150... Line 153...
150
    'orca-web-api',
153
    'orca-web-api',
151
    'orca-web-utils',
154
    'orca-web-utils',
152
    'TestPaymentGateway',
155
    'TestPaymentGateway',
153
    'tgen4j',
156
    'tgen4j',
154
    'web-cd-client',
157
    'web-cd-client',
-
 
158
 
-
 
159
 
-
 
160
    # 05-Nov-12: Pending fixup for include.txt files that escape the VOB
-
 
161
    #
-
 
162
#    'ddu_app_manager',
-
 
163
#    'ddu_dog',
-
 
164
#    'ddu_dog_lib',
-
 
165
#    'ddu_fim',
-
 
166
#    'ddu_logging_lib',
-
 
167
#    'ddu_management',
-
 
168
#    'ddu_mccain',
-
 
169
#    'ddu_mon',
-
 
170
#    'ddu_rcu',
-
 
171
#    'ddu_status_logging',
-
 
172
    
155
);
173
);
156
 
174
 
157
my %specialPackages = (
175
my %specialPackages = (
158
    'core_devl'           =>  ',all,protected,',
176
    'core_devl'           =>  ',all,protected,',
159
    'daf_utils_mos'       => ',flat,',
177
    'daf_utils_mos'       => ',flat,',
Line 163... Line 181...
163
    'ReleaseName'         => ',flat,',
181
    'ReleaseName'         => ',flat,',
164
    'reports'             => ',utf8,',
182
    'reports'             => ',utf8,',
165
    'cda_imports'         => ',utf8,',
183
    'cda_imports'         => ',utf8,',
166
    'cdxforms'            => ',utf8,',
184
    'cdxforms'            => ',utf8,',
167
    'db_cda'              => ',utf8,',
185
    'db_cda'              => ',utf8,',
-
 
186
    'CommandServer'       => ',IgnoreMakeProject,',
-
 
187
    'TDSExporterControl'  => ',IgnoreMakeProject,',
-
 
188
    'cdagui'              => ',IgnoreMakeProject,',
168
 
189
 
169
 
190
 
170
    # Need to be handled in a special manner
191
    # Need to be handled in a special manner
171
    # Not done by this utility
192
    # Not done by this utility
172
    #
193
    #
Line 190... Line 211...
190
    'orahops-ssw-install'       => ',protected,',
211
    'orahops-ssw-install'       => ',protected,',
191
    'orahops-ssw-patch'         => ',protected,',
212
    'orahops-ssw-patch'         => ',protected,',
192
# End of ukHops migration exclussion
213
# End of ukHops migration exclussion
193
 
214
 
194
    'ftp'                   => 'SetProjectBase,',
215
    'ftp'                   => 'SetProjectBase,',
-
 
216
    'ddu_app_manager'       => 'SetProjectBase,',
195
 
217
 
196
    'icl'                   => 'IgnoreProjectBase,',
218
    'icl'                   => 'IgnoreProjectBase,',
197
    'itso'                  => 'IgnoreProjectBase,',
219
    'itso'                  => 'IgnoreProjectBase,',
198
    'daf_osa_mos'           => 'IgnoreProjectBase,',
220
    'daf_osa_mos'           => 'IgnoreProjectBase,',
199
    'daf_utils_mos'         => 'IgnoreProjectBase,',
221
    'daf_utils_mos'         => 'IgnoreProjectBase,',
Line 268... Line 290...
268
my @multiplePaths;
290
my @multiplePaths;
269
my @badEssentials;
291
my @badEssentials;
270
my %svnData;
292
my %svnData;
271
my $cwd;
293
my $cwd;
272
my $mustConvertFileNames;
294
my $mustConvertFileNames;
-
 
295
my $workDir;
273
 
296
 
274
my $packageNames;
297
my $packageNames;
275
my @packageNames;
298
my @packageNames;
276
my $multiPackages = -1;
299
my $multiPackages = -1;
277
my $visitId = 0;
300
my $visitId = 0;
Line 290... Line 313...
290
my $result = GetOptions (
313
my $result = GetOptions (
291
                "help+"         => \$opt_help,          # flag, multiple use allowed
314
                "help+"         => \$opt_help,          # flag, multiple use allowed
292
                "manual:3"      => \$opt_help,
315
                "manual:3"      => \$opt_help,
293
                "verbose:+"     => \$opt_verbose,       # Versose
316
                "verbose:+"     => \$opt_verbose,       # Versose
294
                "repository:s"  => \$opt_repo,          # Name of repository
317
                "repository:s"  => \$opt_repo,          # Name of repository
-
 
318
                'subdir:s'      => \$opt_repoSubdir,    # Subdir within repo
295
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
319
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
296
                "flat!"         => \$opt_flat,          # Flat structure
320
                "flat!"         => \$opt_flat,          # Flat structure
297
                "test!"         => \$opt_test,          # Test operations
321
                "test!"         => \$opt_test,          # Test operations
298
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
322
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
299
                "age:i"         => \$opt_age,           # Only recent versions
323
                "age:i"         => \$opt_age,           # Only recent versions
Line 485... Line 509...
485
    }
509
    }
486
 
510
 
487
    #
511
    #
488
    #   Perform all the work in a package specific subdirectory
512
    #   Perform all the work in a package specific subdirectory
489
    #
513
    #
490
    my $workDir = $opt_workDir . '/' . $packageNames;
514
    $workDir = $opt_workDir . '/' . $packageNames;
491
    mkdir $workDir unless ( -d $workDir );
515
    mkdir $workDir unless ( -d $workDir );
492
    chdir $workDir || Error ("Cannot cd to $workDir");
516
    chdir $workDir || Error ("Cannot cd to $workDir");
493
 
517
 
494
    #
518
    #
495
    #   Process all packages
519
    #   Process all packages
Line 673... Line 697...
673
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
697
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
674
            $opt_ignoreProjectBaseErrors = 1;
698
            $opt_ignoreProjectBaseErrors = 1;
675
            Message ("Ignore ProjectBase Errors");
699
            Message ("Ignore ProjectBase Errors");
676
        }
700
        }
677
 
701
 
-
 
702
        if ( index( $data, 'IgnoreMakeProject,' ) >= 0) {
-
 
703
            $opt_ignoreMakeProjectErrors = 1;
-
 
704
            Message ("Ignore MakeProject Usage");
-
 
705
        }
-
 
706
        
-
 
707
 
678
        if ( index( $data, 'utf8,' ) >= 0) {
708
        if ( index( $data, 'utf8,' ) >= 0) {
679
            $mustConvertFileNames = 1;
709
            $mustConvertFileNames = 1;
680
            Message ("Convert filenames to UTF8");
710
            Message ("Convert filenames to UTF8");
681
        }
711
        }
682
    }
712
    }
Line 1653... Line 1683...
1653
        }
1683
        }
1654
 
1684
 
1655
    }
1685
    }
1656
    else
1686
    else
1657
    {
1687
    {
1658
        Message ("No view to delete: $data{ViewRoot}");
1688
        Message ("No view to delete");
1659
    }
1689
    }
1660
 
1690
 
1661
 
1691
 
1662
    #
1692
    #
1663
    #   If this version has any 'ripples' then process them while we have the
1693
    #   If this version has any 'ripples' then process them while we have the
Line 1829... Line 1859...
1829
    #
1859
    #
1830
    $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
1860
    $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
1831
    return $rv if ( $rv );
1861
    return $rv if ( $rv );
1832
 
1862
 
1833
    #
1863
    #
1834
    #   Some really ugly packages make use of a Jats feature called 'SetProjectBase'
-
 
1835
    #   Detect such packages as we will need to handle them differently
-
 
1836
    #   Can't really handle it on the fly
-
 
1837
    #   All we can do is detect it and report it - at the moment
-
 
1838
    #
-
 
1839
    if (detectProjectBaseUsage($data, $cc_path) )
-
 
1840
    {
-
 
1841
        unless ( $opt_ignoreProjectBaseErrors )
-
 
1842
        {
-
 
1843
            $data->{BadProjectBase}++;
-
 
1844
            $data->{errStr} = 'Bad usage of ProjectBase detected';
-
 
1845
            return 4;           # Lets see what the others look like too
-
 
1846
#            return 14;
-
 
1847
        }
-
 
1848
    }
-
 
1849
 
-
 
1850
 
-
 
1851
    #
-
 
1852
    #   Developers have been slack
1864
    #   Developers have been slack
1853
    #       Sometime the mark the source path as 'GMTPE2005'
1865
    #       Sometime the mark the source path as 'GMTPE2005'
1854
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
1866
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
1855
    #
1867
    #
1856
    #   Attempt to suck up empty directories below the specified
1868
    #   Attempt to suck up empty directories below the specified
Line 1869... Line 1881...
1869
            Message ("Adjust Base Dir: $testDir");
1881
            Message ("Adjust Base Dir: $testDir");
1870
            $data->{adjustedPath} = $data->{ViewPath};
1882
            $data->{adjustedPath} = $data->{ViewPath};
1871
            $data->{ViewPath} = $testDir;
1883
            $data->{ViewPath} = $testDir;
1872
        }
1884
        }
1873
    }
1885
    }
-
 
1886
    
-
 
1887
    #
-
 
1888
    #   Some really ugly packages make use of a Jats feature called 'SetProjectBase'
-
 
1889
    #   Detect such packages as we will need to handle them differently
-
 
1890
    #   Can't really handle it on the fly
-
 
1891
    #   All we can do is detect it and report it - at the moment
-
 
1892
    #
-
 
1893
    if (detectProjectBaseUsage($data, $cc_path) )
-
 
1894
    {
-
 
1895
        unless ( $opt_ignoreProjectBaseErrors )
-
 
1896
        {
-
 
1897
            $data->{BadProjectBase}++;
-
 
1898
            $data->{errStr} = 'Bad usage of ProjectBase detected';
-
 
1899
            return 4;           # Lets see what the others look like too
-
 
1900
#            return 14;
-
 
1901
        }
-
 
1902
    }
-
 
1903
 
-
 
1904
    #
-
 
1905
    #   Some really really ugly packgaes make use of the MakeProject directive
-
 
1906
    #   and then use an 'include.txt file to access paths all over the VOB
-
 
1907
    #   The problem is with lines like
-
 
1908
    #           /I ..\..\..\..\..\..\DPG_SWCode\projects\seattle\ddu\component\DTIApp\dsi\inc
-
 
1909
    #   Two problems:
-
 
1910
    #       Vob Name is not a part of the migration
-
 
1911
    #       If we 'SuckUp' empty directories then this may break
-
 
1912
    #       the pathing.
-
 
1913
    #   All we can do is detect it and report it - at the moment
-
 
1914
    #
-
 
1915
    if (detectMakeProjectUsage($data, $cc_path) )
-
 
1916
    {
-
 
1917
        unless ( $opt_ignoreMakeProjectErrors )
-
 
1918
        {
-
 
1919
            $data->{BadMakeProject}++;
-
 
1920
            $data->{errStr} = 'Use of MakeProject detected';
-
 
1921
            return 4;           # Lets see what the others look like too
-
 
1922
#            return 14;
-
 
1923
        }
-
 
1924
    }
1874
 
1925
 
1875
    #
1926
    #
1876
    #   Some packages have filenames that are need to be converted
1927
    #   Some packages have filenames that are need to be converted
1877
    #
1928
    #
1878
    if ( $mustConvertFileNames || 1  )
1929
    if ( $mustConvertFileNames  )
1879
    {
1930
    {
1880
        $rv = system ( '/home/dpurdie/svn/tools/convmv-1.15/convmv',
1931
        $rv = system ( '/home/dpurdie/svn/tools/convmv-1.15/convmv',
1881
                 '-fiso-8859-1',
1932
                 '-fiso-8859-1',
1882
                 '-tutf8',
1933
                 '-tutf8',
1883
                 '-r',
1934
                 '-r',
Line 1887... Line 1938...
1887
        if ( $rv )
1938
        if ( $rv )
1888
        {
1939
        {
1889
            $data->{errStr} = 'Failed to convert filenames to UTF8';
1940
            $data->{errStr} = 'Failed to convert filenames to UTF8';
1890
            return 14;
1941
            return 14;
1891
        }
1942
        }
-
 
1943
 
-
 
1944
        #
-
 
1945
        #   Check to see if our ViewPath has been changed
-
 
1946
        #   If so, then try to fix it
-
 
1947
        #
-
 
1948
        unless ( -d $data->{ViewPath} )
-
 
1949
        {
-
 
1950
            Message ("Correct UTF-8 change to ViewPath");
-
 
1951
            $data->{ViewPath} = encode('UTF-8', $data->{ViewPath}, Encode::FB_DEFAULT);
-
 
1952
            Warning ("Correct UTF-8 change to ViewPath - FAILED") unless ( -d $data->{ViewPath} );
-
 
1953
        }
1892
    }
1954
    }
1893
    
1955
    
1894
 
-
 
1895
    #
1956
    #
1896
    #   Have a CC view
1957
    #   Have a CC view
1897
    #   Now we can create the SVN package and branching point before we
1958
    #   Now we can create the SVN package and branching point before we
1898
    #   import the CC data into SVN
1959
    #   import the CC data into SVN
1899
    #
1960
    #
Line 2464... Line 2525...
2464
    return 2;
2525
    return 2;
2465
 
2526
 
2466
}
2527
}
2467
 
2528
 
2468
#-------------------------------------------------------------------------------
2529
#-------------------------------------------------------------------------------
-
 
2530
# Function        : detectMakeProjectUsage
-
 
2531
#
-
 
2532
# Description     : etect and report usage of the MakeProject directive
-
 
2533
#
-
 
2534
# Inputs          : $data               - Ref to a hash of bits
-
 
2535
#                   $cc_path            - Packages cc_path
-
 
2536
#
-
 
2537
# Returns         : true    - Bad usage (Really good usage not detected)
-
 
2538
#                   false   - Good usage detected
-
 
2539
#
-
 
2540
sub detectMakeProjectUsage
-
 
2541
{
-
 
2542
    my ($data, $cc_path) = @_;
-
 
2543
    my $retval = 0;
-
 
2544
    my $eSuf = $opt_ignoreMakeProjectErrors ? '' : 'Error';
-
 
2545
 
-
 
2546
    #
-
 
2547
    #   Find makefile.pl
-
 
2548
    #
-
 
2549
    Message ("Locate JATS makefiles");
-
 
2550
    my $usesMakeProject = 0;
-
 
2551
    my $badIncludeFile = 0;
-
 
2552
 
-
 
2553
    my $search = JatsLocateFiles->new("--Recurse=1",
-
 
2554
                                       "--FilterIn=makefile.pl",
-
 
2555
                                       );
-
 
2556
    my @makefiles = $search->search($data->{ViewRoot});
-
 
2557
    foreach my $file ( @makefiles )
-
 
2558
    {
-
 
2559
#print "---Reading: $workDir/$data->{ViewRoot}/$file\n";
-
 
2560
        if ( open( my $fh, '<', "$data->{ViewRoot}/$file" ) )
-
 
2561
        {
-
 
2562
            my $eof = 0;
-
 
2563
            my $line = '';
-
 
2564
            until ( $eof )
-
 
2565
            {
-
 
2566
                my $in = <$fh>;
-
 
2567
                unless ( defined $in )
-
 
2568
                {
-
 
2569
                    $eof = 1;
-
 
2570
                }
-
 
2571
                else
-
 
2572
                {
-
 
2573
                $in =~ s~\s+$~~;
-
 
2574
                $in =~ s~^\s+~~;
-
 
2575
                $in =~ s~^#.*$~~;
-
 
2576
                $in =~ s~\s*[^\$]#.*$~~;
-
 
2577
                $line .= ' ' if ( $line );
-
 
2578
                $line .= $in;
-
 
2579
                $line =~ s~\s+~ ~g;
-
 
2580
#print "====== '$line'\n";
-
 
2581
                redo unless ( $line =~ m~;$~  );
-
 
2582
                }
-
 
2583
#print "---- $line\n";
-
 
2584
                if ( $line =~ m~^MakeProject~ )
-
 
2585
                {
-
 
2586
                    $usesMakeProject++;
-
 
2587
                    $data->{UsesMakeProject}++;
-
 
2588
                    Warning ("Package uses MakeProject:",
-
 
2589
                             "Line: " . $line,
-
 
2590
                             "Root: " . "$data->{ViewRoot}",
-
 
2591
                             "File: " . "$data->{ViewRoot}/$file",
-
 
2592
                            );
-
 
2593
 
-
 
2594
                    #
-
 
2595
                    #   Extract out the project name
-
 
2596
                    #
-
 
2597
                    my @myArgs;
-
 
2598
                    my $myProjectDir;
-
 
2599
                    my $myProject = "$data->{ViewRoot}/$file";
-
 
2600
                    $myProject =~ s~/[^/]+$~~;
-
 
2601
                    $line =~ s~MakeProject~push \@myArgs,~;
-
 
2602
                    eval $line;
-
 
2603
                    Error("Line did not compiler: $line", "Err: $@" ) if ($@);
-
 
2604
                    shift @myArgs;
-
 
2605
                    foreach ( @myArgs )
-
 
2606
                    {
-
 
2607
                        next if ( m~^--~ );
-
 
2608
                        $myProject .= '/' . $_;
-
 
2609
                        $myProjectDir = $myProject;
-
 
2610
                        $myProjectDir =~ s~/[^/]+$~~;
-
 
2611
                        last;
-
 
2612
                    }
-
 
2613
                    Error ("No project Found") unless ( defined $myProjectDir);
-
 
2614
                    if ( -f "$myProjectDir/include.txt" )
-
 
2615
                    {
-
 
2616
                        Warning ("Co-located 'include.txt' file also found");
-
 
2617
                    }
-
 
2618
 
-
 
2619
                    # The only problem is if the include.txt file
-
 
2620
                    # escapes from the VOB - or even uses the vob root
-
 
2621
                    #
-
 
2622
                    # Examine the include file
-
 
2623
                    # Expect it to look like
-
 
2624
                    #   /I Path
-
 
2625
                    #
-
 
2626
 
-
 
2627
                    #
-
 
2628
                    #   Determine safe level
-
 
2629
                    #   Relative to the include file
-
 
2630
                    #
-
 
2631
                    my $depthPath = $myProjectDir;
-
 
2632
                    my $depth = 0;
-
 
2633
                    Error ("Expect this to work") unless ( $depthPath =~ s~^$data->{ViewRoot}/~~ );
-
 
2634
                    foreach ( split('/', $depthPath) )
-
 
2635
                    {
-
 
2636
                        if ( $_ eq '..' ) {
-
 
2637
                            $depth--;
-
 
2638
                        } else {
-
 
2639
                            $depth++;
-
 
2640
                        }
-
 
2641
                    }
-
 
2642
#print "Depth: $depth, $depthPath\n";
-
 
2643
 
-
 
2644
                    if ( open( my $if, '<', "$myProjectDir/include.txt" ) )
-
 
2645
                    {
-
 
2646
                        while ( <$if> )
-
 
2647
                        {
-
 
2648
                            s~\s+$~~;
-
 
2649
                            s~^\s+~~;
-
 
2650
                            next unless ( $_ );
-
 
2651
                            if ( m~/I\s+(.*)~ )
-
 
2652
                            {
-
 
2653
                                my $path = $1;
-
 
2654
                                $path =~ tr~\\/~/~s;
-
 
2655
                                $path =~ s~\\~/~g;
-
 
2656
#print "Examine: $path\n";
-
 
2657
                                my $minLevel = 0;
-
 
2658
                                my $level = 0;
-
 
2659
                                foreach ( split('/', $path) )
-
 
2660
                                {
-
 
2661
                                    if ( $_ eq '..' )
-
 
2662
                                    {
-
 
2663
                                        $level--;
-
 
2664
                                        $minLevel = $level if ($level < $minLevel);
-
 
2665
                                    }
-
 
2666
                                    else
-
 
2667
                                    {
-
 
2668
                                        $level++;
-
 
2669
                                    }
-
 
2670
                                }
-
 
2671
#print "Min: $minLevel, $level, ($depth + $minLevel)\n";
-
 
2672
                                if ( $depth + $minLevel <= 0)
-
 
2673
                                {
-
 
2674
                                    $badIncludeFile++;
-
 
2675
                                    Warning ("Included path escapes package:",
-
 
2676
                                             "Line: " . $_,
-
 
2677
                                             "File: " . "$myProjectDir/include.txt",
-
 
2678
                                            );
-
 
2679
                                    last;
-
 
2680
                                }
-
 
2681
                            }
-
 
2682
                        }
-
 
2683
                        close $if;
-
 
2684
                    }
-
 
2685
 
-
 
2686
                }
-
 
2687
                $line = '';
-
 
2688
            }
-
 
2689
            close $fh;
-
 
2690
        }
-
 
2691
        else
-
 
2692
        {
-
 
2693
            Warning ("MakeProject$eSuf - Cannot open makefile: $file");
-
 
2694
            $retval = 1;
-
 
2695
        }
-
 
2696
    }
-
 
2697
 
-
 
2698
    #
-
 
2699
    #   Used
-
 
2700
    #   May be improved latter
-
 
2701
    #
-
 
2702
    if ( $usesMakeProject && $badIncludeFile)
-
 
2703
    {
-
 
2704
        Warning ("MakeProject$eSuf - Problem detected");
-
 
2705
        $retval = 1;
-
 
2706
    }
-
 
2707
 
-
 
2708
    #
-
 
2709
    #   Until we have more faith in the detection algorithm
-
 
2710
    #
-
 
2711
    if ( $usesMakeProject )
-
 
2712
    {
-
 
2713
        Warning ("MakeProject$eSuf - Makeproject used. Must check manually");
-
 
2714
        $retval = 1;
-
 
2715
    }
-
 
2716
    
-
 
2717
    return $retval;
-
 
2718
}
-
 
2719
 
-
 
2720
#-------------------------------------------------------------------------------
2469
# Function        : detectProjectBaseUsage
2721
# Function        : detectProjectBaseUsage
2470
#
2722
#
2471
# Description     : Detect and report usage of the SetProjectBase directive
2723
# Description     : Detect and report usage of the SetProjectBase directive
2472
#
2724
#
2473
# Inputs          : $data               - Ref to a hash of bits
2725
# Inputs          : $data               - Ref to a hash of bits
Line 3779... Line 4031...
3779
    #
4031
    #
3780
    Warning ("No VOB Mapping found")
4032
    Warning ("No VOB Mapping found")
3781
        unless ($opt_vobMap);
4033
        unless ($opt_vobMap);
3782
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4034
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
3783
        unless ( $opt_repo || $opt_vobMap );
4035
        unless ( $opt_repo || $opt_vobMap );
3784
 
-
 
3785
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '');
4036
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
-
 
4037
    $r1 =~ s~//~/~g;
3786
    $r1 =~ s~^/~~;
4038
    $r1 =~ s~^/~~;
3787
    $r1 =~ s~/$~~;
4039
    $r1 =~ s~/$~~;
3788
    $svnRepo = $opt_repo_base . $r1;
4040
    $svnRepo = $opt_repo_base . $r1;
3789
 
4041
 
3790
    Verbose( "Repo URL: $svnRepo");
4042
    Verbose( "Repo URL: $svnRepo");