Subversion Repositories DevTools

Rev

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

Rev 3559 Rev 3832
Line 73... Line 73...
73
my $opt_ignoreProjectBaseErrors;
73
my $opt_ignoreProjectBaseErrors;
74
my $opt_ignoreMakeProjectErrors;
74
my $opt_ignoreMakeProjectErrors;
75
my $opt_ignoreBuildFileClashes;
75
my $opt_ignoreBuildFileClashes;
76
my $opt_forceProjectBase;
76
my $opt_forceProjectBase;
77
my @opt_limitProjectBase;
77
my @opt_limitProjectBase;
-
 
78
my @opt_selectProjectBase;
78
my @opt_mergePaths;
79
my @opt_mergePaths;
79
my $opt_ignoreBadPaths;
80
my $opt_ignoreBadPaths;
80
my $opt_delete;
81
my $opt_delete;
81
my $opt_recentAge = 14;             # Days
82
my $opt_recentAge = 14;             # Days
82
my $opt_relabel = 0;
83
my $opt_relabel = 0;
Line 88... Line 89...
88
my $opt_resume;
89
my $opt_resume;
89
my $opt_processRipples = 1;
90
my $opt_processRipples = 1;
90
my $opt_mergePackages;
91
my $opt_mergePackages;
91
my @opt_deleteFiles;
92
my @opt_deleteFiles;
92
my $opt_useTestRepo;
93
my $opt_useTestRepo;
-
 
94
my $opt_saveCompressed;
-
 
95
my $opt_skipBuildNameCheck;
-
 
96
my $opt_deleteLinks;
93
 
97
 
94
################################################################################
98
################################################################################
95
#   List of Projects Suffixes and Branch Names to be used within SVN
99
#   List of Projects Suffixes and Branch Names to be used within SVN
96
#
100
#
97
#       Name        - Name of branch for the project
101
#       Name        - Name of branch for the project
Line 299... Line 303...
299
 
303
 
300
    'br_applets'                      => 'flatTime,LimitProjectBase=/ProjectCD/seattle'.
304
    'br_applets'                      => 'flatTime,LimitProjectBase=/ProjectCD/seattle'.
301
                                       ',mergePaths=++:build/**:Sales/**:FarePayment/**:KCM/**:unit_test/**:VP/**:WSF/**'.
305
                                       ',mergePaths=++:build/**:Sales/**:FarePayment/**:KCM/**:unit_test/**:VP/**:WSF/**'.
302
                                       ',processRipples',
306
                                       ',processRipples',
303
 
307
 
304
    'CDAdministration'                => 'NoRetain,IgnoreMakeProject,XXXXLimitProjectBase=/MASS_Dev_Infra',
308
    'CDAdministration'                => 'RetainCompressed,IgnoreMakeProject,SelectProjectBase=MASS_Dev_Infra/DeviceCDManagement/cpp/CDAdministrator:MASS_Dev_Infra/CDAdministrator:MASS_Dev_Infra/CDAdministrator_vt:MASS_Dev_Infra/Cda/java:MASS_Dev_Infra/CDA:MASS_Dev_Infra',
305
    
309
    
-
 
310
    'obme'       => ',IgnoreMakeProject,',
306
 
311
 
-
 
312
    'apportionment'                    => 'SkipBuildFileCheck',
-
 
313
    'almgr'                            => 'SkipBuildFileCheck,SelectProjectBase=MASS_Dev_Bus/CBP/al/almgr/cpp:MASS_Dev_Bus/CBP/al/almgr:MASS_Dev_Bus/CBP/al:MASS_Dev_Bus/CBP',
-
 
314
    'cvm'                              => 'SelectProjectBase=MASS_Dev_Bus/CBP/cvm/cpp:MASS_Dev_Bus/CBP/cvm',
-
 
315
    'esvrapi'                          => 'SelectProjectBase=MASS_Dev_Bus/CBP/enquiry/esvrapi/cpp:MASS_Dev_Bus/CBP/enquiry/esvrapi',
-
 
316
    'Validation'                       => 'SelectProjectBase=MASS_Dev_Bus/CBP/validation/validation/cpp:MASS_Dev_Bus/CBP/validation/validation',
-
 
317
    'txnfilter'                        => 'DeleteLinks,SelectProjectBase=MASS_Dev_Bus/CBP/txnfilter/txnfilter:MASS_Dev_Bus/CBP/txnfilter/cpp:MASS_Dev_Bus/CBP/txnfilter',
-
 
318
 
-
 
319
    'card'                       => 'SelectProjectBase=MASS_Dev_Bus/Card/cpp:MASS_Dev_Bus/Card',
-
 
320
    'cbps'                       => 'SelectProjectBase=MASS_Dev_Bus/CBP/cbps/cpp:MASS_Dev_Bus/CBP/cbps:MASS_Dev_Bus/CBP',
-
 
321
    'issuercommon'               => 'SelectProjectBase=MASS_Dev_Bus/Issuer/issuerCommon/cpp:MASS_Dev_Bus/Issuer/issuerCommon',
-
 
322
    'ivp'                        => 'SelectProjectBase=MASS_Dev_Bus/CBP/ivp/ivp/cpp:MASS_Dev_Bus/CBP/ivp/ivp:MASS_Dev_Bus/CBP/ivp:MASS_Dev_Bus/CBP',
-
 
323
 
-
 
324
    'daf_transap_mag'            => 'SelectProjectBase=DPG_SWBase/transap/proxy/mag:DPG_SWBase/transap/proxy',
-
 
325
    'daf_transap_proxyman'       => 'SelectProjectBase=DPG_SWBase/transap/proxymanager',
-
 
326
    'daf_transap_rkf'            => 'SkipBuildFileCheck',
-
 
327
 
-
 
328
    'daf_cd_common'              => 'IgnoreProjectBase',
-
 
329
    
307
 
330
 
308
    'icl'                   => 'IgnoreProjectBase,',
331
    'icl'                   => 'IgnoreProjectBase,',
309
    'itso'                  => 'IgnoreProjectBase,',
332
    'itso'                  => 'IgnoreProjectBase,',
310
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
333
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
311
    'daf_utils_mos'         => 'IgnoreProjectBase,',
334
    'daf_utils_mos'         => 'IgnoreProjectBase,',
Line 1011... Line 1034...
1011
            $opt_AllowMuliplePaths = 1;
1034
            $opt_AllowMuliplePaths = 1;
1012
            @opt_limitProjectBase = split(':', $1);
1035
            @opt_limitProjectBase = split(':', $1);
1013
            Message ("Limit Project Base: @opt_limitProjectBase");
1036
            Message ("Limit Project Base: @opt_limitProjectBase");
1014
        }
1037
        }
1015
 
1038
 
-
 
1039
        if ( $data =~ m~,SelectProjectBase=(.*?),~ ) {
-
 
1040
            $opt_AllowMuliplePaths = 1;
-
 
1041
            @opt_selectProjectBase = split(':', $1);
-
 
1042
            Message ("Select Project Base from: @opt_selectProjectBase");
-
 
1043
        }
-
 
1044
        
1016
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
1045
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
1017
            @opt_mergePaths = split(':', $1);
1046
            @opt_mergePaths = split(':', $1);
1018
            Message ("Merge Paths: @opt_mergePaths");
1047
            Message ("Merge Paths: @opt_mergePaths");
1019
        }
1048
        }
1020
 
1049
 
1021
        if ( $data =~ m~,DeleteFiles=(.*?),~ ) {
1050
        if ( $data =~ m~,DeleteFiles=(.*?),~ ) {
1022
            @opt_deleteFiles = split(':', $1);
1051
            @opt_deleteFiles = split(':', $1);
1023
            Message ("Delete Files: @opt_deleteFiles");
1052
            Message ("Delete Files: @opt_deleteFiles");
1024
        }
1053
        }
-
 
1054
 
-
 
1055
        if ( $data =~ m~,DeleteLinks,~ ) {
-
 
1056
            $opt_deleteLinks = 1;
-
 
1057
            Message ("Delete soft links");
-
 
1058
        }
1025
        
1059
        
1026
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
1060
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
1027
            $opt_ignoreProjectBaseErrors = 1;
1061
            $opt_ignoreProjectBaseErrors = 1;
1028
            Message ("Ignore ProjectBase Errors");
1062
            Message ("Ignore ProjectBase Errors");
1029
        }
1063
        }
Line 1031... Line 1065...
1031
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
1065
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
1032
            $opt_ignoreMakeProjectErrors = 1;
1066
            $opt_ignoreMakeProjectErrors = 1;
1033
            Message ("Ignore MakeProject Usage");
1067
            Message ("Ignore MakeProject Usage");
1034
        }
1068
        }
1035
 
1069
 
1036
        if ( index( $data, ',IgnoreBuildFileClash,' ) >= 0) {
1070
        if ( index( $data, ',NoBuildFileCheck,' ) >= 0) {
1037
            $opt_ignoreBuildFileClashes = 1;
1071
            $opt_ignoreBuildFileClashes = 1;
1038
            Message ("Ignoring Build File Clashes");
1072
            Message ("Ignoring Build File Clashes");
1039
        }
1073
        }
1040
 
1074
 
-
 
1075
        if ( index( $data, ',SkipBuildFileCheck,' ) >= 0) {
-
 
1076
            $opt_skipBuildNameCheck = 1;
-
 
1077
            Message ("Skip Build File Clashes Testing");
-
 
1078
        }
-
 
1079
        
1041
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
1080
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
1042
            $opt_ignoreBadPaths = 1;
1081
            $opt_ignoreBadPaths = 1;
1043
            Message ("Ignore Bad Paths in makefile Usage");
1082
            Message ("Ignore Bad Paths in makefile Usage");
1044
        }
1083
        }
1045
        
1084
        
Line 1051... Line 1090...
1051
        if ( index( $data, ',NoRetain,' ) >= 0) {
1090
        if ( index( $data, ',NoRetain,' ) >= 0) {
1052
            $opt_reuse = 2;
1091
            $opt_reuse = 2;
1053
            Message ("Package Versions not Retained");
1092
            Message ("Package Versions not Retained");
1054
        }
1093
        }
1055
 
1094
 
-
 
1095
        if ( index( $data, ',RetainCompressed,' ) >= 0) {
-
 
1096
            $opt_saveCompressed = 1;
-
 
1097
            Message ("Package Versions will be retained as compressed images");
-
 
1098
        }
-
 
1099
        
-
 
1100
 
1056
        if ( $data =~ m~,Trunk=(.*?),~ ) {
1101
        if ( $data =~ m~,Trunk=(.*?),~ ) {
1057
            my $tt = $1;
1102
            my $tt = $1;
1058
            $Projects{$tt}{Trunk} = 1;
1103
            $Projects{$tt}{Trunk} = 1;
1059
            Message ("Force project to trunk: $tt");
1104
            Message ("Force project to trunk: $tt");
1060
        }
1105
        }
Line 2086... Line 2131...
2086
    #   Delete the created view
2131
    #   Delete the created view
2087
    #   Its just a directory, so delete it
2132
    #   Its just a directory, so delete it
2088
    #
2133
    #
2089
    if ( $data{ViewRoot} && -d $data{ViewRoot})
2134
    if ( $data{ViewRoot} && -d $data{ViewRoot})
2090
    {
2135
    {
-
 
2136
        my $cfile = saneLabel($entry) . '.tgz';
2091
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
2137
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
2092
        {
2138
        {
2093
            Message ("Delete View: $data{ViewRoot}");
2139
            Message ("Delete View: $data{ViewRoot}");
2094
            RmDirTree ($data{ViewRoot} );
2140
            RmDirTree ($data{ViewRoot} );
-
 
2141
            unlink $cfile;
2095
        }
2142
        }
2096
        else
2143
        else
2097
        {
2144
        {
2098
            Message ("Retaining View: $data{ViewRoot}");
2145
            Message ("Retaining View: $data{ViewRoot}");
-
 
2146
            if ( $opt_saveCompressed )
-
 
2147
            {
-
 
2148
                Message ("Compressing the retained directory");
-
 
2149
                unless ( -f $cfile )
-
 
2150
                {
-
 
2151
                    my $rv = System ('tar', '-czf', $cfile, $data{ViewRoot} );
-
 
2152
                    if ( $rv )
-
 
2153
                    {
-
 
2154
                        Warning("Failed to compress directory");
-
 
2155
                    }
-
 
2156
                }
-
 
2157
                else
-
 
2158
                {
-
 
2159
                    Message ("Reusing compressed file");
-
 
2160
                }
-
 
2161
                RmDirTree ($data{ViewRoot} );
-
 
2162
            }
2099
        }
2163
        }
2100
 
2164
 
2101
    }
2165
    }
2102
    else
2166
    else
2103
    {
2167
    {
Line 2169... Line 2233...
2169
    my $rv;
2233
    my $rv;
2170
    my $vcs_type;
2234
    my $vcs_type;
2171
    my $cc_label;
2235
    my $cc_label;
2172
    my $cc_path;
2236
    my $cc_path;
2173
    my $cc_path_original;
2237
    my $cc_path_original;
-
 
2238
    my $selectDir;
2174
 
2239
 
2175
    #
2240
    #
2176
    #   Init Data
2241
    #   Init Data
2177
    #
2242
    #
2178
    $data->{rmRef} = 'ERROR';
2243
    $data->{rmRef} = 'ERROR';
Line 2344... Line 2409...
2344
            {
2409
            {
2345
                $cc_path = $_;
2410
                $cc_path = $_;
2346
                last;
2411
                last;
2347
            }
2412
            }
2348
        }
2413
        }
2349
        
2414
 
2350
        if ( $cc_path_original ne $cc_path )
2415
        if ( $cc_path_original ne $cc_path )
2351
        {
2416
        {
2352
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2417
                Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
2353
        }
2418
        }
2354
    }
2419
    }
Line 2366... Line 2431...
2366
        #   Create CC view
2431
        #   Create CC view
2367
        #   Import into Subversion View
2432
        #   Import into Subversion View
2368
        #
2433
        #
2369
        $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label, $entry );
2434
        $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label, $entry );
2370
        return $rv if ( $rv );
2435
        return $rv if ( $rv );
-
 
2436
 
-
 
2437
        #
-
 
2438
        #   May need to limit the extracted source tree
-
 
2439
        #   Use the first selected directory that we have
-
 
2440
        #
-
 
2441
        if ( @opt_selectProjectBase )
-
 
2442
        {
-
 
2443
            foreach ( @opt_selectProjectBase )
-
 
2444
            {
-
 
2445
                my $testDir = join('/', $data->{ViewRoot}, $_);
-
 
2446
                if ( -d $testDir )
-
 
2447
                {
-
 
2448
                    $selectDir = $_;
-
 
2449
                    $data->{ViewPath} = $testDir;
-
 
2450
                    last;
-
 
2451
                }
-
 
2452
            }
-
 
2453
 
-
 
2454
            unless ( $selectDir )
-
 
2455
            {
-
 
2456
                Warning ("No directory selected from list");
-
 
2457
            }
-
 
2458
            else
-
 
2459
            {
-
 
2460
                Message ("Selecting Dir: /$selectDir");
-
 
2461
            }
-
 
2462
        }
2371
    }
2463
    }
2372
    
-
 
2373
 
2464
 
2374
    #
2465
    #
2375
    #   Delete specified files from the source tree
2466
    #   Delete specified files from the source tree
2376
    #
2467
    #
2377
    if ( @opt_deleteFiles )
2468
    if ( @opt_deleteFiles )
Line 2390... Line 2481...
2390
            unlink ( join ('/', $data->{ViewRoot}, $rmFile) )|| Warning "Cannot delete: $rmFile";
2481
            unlink ( join ('/', $data->{ViewRoot}, $rmFile) )|| Warning "Cannot delete: $rmFile";
2391
        }
2482
        }
2392
    }
2483
    }
2393
 
2484
 
2394
    #
2485
    #
-
 
2486
    #   Some packages contain softlinks - that break the file scanner
-
 
2487
    #
-
 
2488
    if ( $opt_deleteLinks )
-
 
2489
    {
-
 
2490
        # Not doing anything yet - fixed the JATS find bit
-
 
2491
    }
-
 
2492
 
-
 
2493
    #
2395
    #   Developers have been slack
2494
    #   Developers have been slack
2396
    #       Sometime the mark the source path as 'GMTPE2005'
2495
    #       Sometime the mark the source path as 'GMTPE2005'
2397
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2496
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
2398
    #
2497
    #
2399
    #   Attempt to suck up empty directories below the specified
2498
    #   Attempt to suck up empty directories below the specified
2400
    #   source path
2499
    #   source path
2401
    #
2500
    #
2402
    unless ( $opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase)
2501
    unless ( $opt_preserveProjectBase || $opt_forceProjectBase || @opt_limitProjectBase || $selectDir)
2403
    {
2502
    {
2404
        #
2503
        #
2405
        #   Look in ViewPath
2504
        #   Look in ViewPath
2406
        #   If it contains only ONE directory then we can suck it up
2505
        #   If it contains only ONE directory then we can suck it up
2407
        #
2506
        #
Line 2618... Line 2717...
2618
    #   Detect potential build problems where multiple buildfiles
2717
    #   Detect potential build problems where multiple buildfiles
2619
    #   exists and cannot be resolved by our build system
2718
    #   exists and cannot be resolved by our build system
2620
    #
2719
    #
2621
    #   This is not a show stopper (yet)
2720
    #   This is not a show stopper (yet)
2622
    #
2721
    #
2623
    if (detectBuildFileClashes($data, 'SvnImportDir'))
2722
    unless ( $opt_skipBuildNameCheck )
2624
    {
2723
    {
2625
        unless ( $opt_ignoreBuildFileClashes )
2724
        if (detectBuildFileClashes($data, 'SvnImportDir'))
2626
        {
2725
        {
-
 
2726
            unless ( $opt_ignoreBuildFileClashes )
-
 
2727
            {
2627
            $data->{BuildFileClash}++;
2728
                $data->{BuildFileClash}++;
2628
            Message ("Build File Clash detected");
2729
                Message ("Build File Clash detected");
-
 
2730
            }
2629
        }
2731
        }
2630
    }
2732
    }
-
 
2733
    else
-
 
2734
    {
-
 
2735
        Message ('Detect Build File Clashes - skipped');
-
 
2736
    }
2631
 
2737
 
2632
    $versions{$entry}{TagCreated} = 1;
2738
    $versions{$entry}{TagCreated} = 1;
2633
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
2739
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
2634
 
2740
 
2635
    #
2741
    #
Line 3121... Line 3227...
3121
        $data->{errStr} = 'View specifically ignored';
3227
        $data->{errStr} = 'View specifically ignored';
3122
        $data->{errCode} = '0';
3228
        $data->{errCode} = '0';
3123
        return 4;               # Will Retain view
3229
        return 4;               # Will Retain view
3124
    }
3230
    }
3125
 
3231
 
-
 
3232
    #
-
 
3233
    #   Attempt to reuse compressed file
-
 
3234
    #
-
 
3235
    if ( $opt_reuse )
-
 
3236
    {
-
 
3237
        my $cfile = saneLabel($entry) . '.tgz';
-
 
3238
        if ( -f $cfile )
-
 
3239
        {
-
 
3240
            Message ("Restoring compressed image");
-
 
3241
            my $rv = System ('tar', '-xzf', $cfile );
-
 
3242
            if ( $rv )
-
 
3243
            {
-
 
3244
                Warning("Failed to decompress directory");
-
 
3245
                $data->{errStr} = 'Failed to de-tar compressed image';
-
 
3246
                return 2;
-
 
3247
            }
-
 
3248
            else
-
 
3249
            {
-
 
3250
                my $cc_vob = $cc_path;
-
 
3251
                $cc_vob =~ s~^/~~;
-
 
3252
                $cc_vob =~ s~/.*~~;
-
 
3253
                my $detarPath =  $data->{ViewRoot} . '/' . $cc_vob;
-
 
3254
 
-
 
3255
                Error ("Logic error: Did not de-tar into expected location", $detarPath)
-
 
3256
                    unless ( -d $detarPath  );
-
 
3257
 
-
 
3258
                if ( -d $data->{ViewPath}  )
-
 
3259
                {
-
 
3260
                    # All is good
-
 
3261
                    return 0;
-
 
3262
                }
-
 
3263
 
-
 
3264
                # Recalc ViewPath to the root of the VOB
-
 
3265
                $cc_path =~ s~^/~~;
-
 
3266
                $cc_path =~ s~/.*~~;
-
 
3267
                $cc_path = '/' . $cc_path;
-
 
3268
                $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
-
 
3269
 
-
 
3270
                return 0;
-
 
3271
            }
-
 
3272
        }
-
 
3273
    }
-
 
3274
 
3126
    if ( $opt_reuse && -d $data->{ViewPath}  )
3275
    if ( $opt_reuse && -d $data->{ViewPath}  )
3127
    {
3276
    {
3128
        Message ("Reusing view: $cc_label");
3277
        Message ("Reusing view: $cc_label");
3129
 
3278
 
3130
        #
3279
        #
Line 3908... Line 4057...
3908
 
4057
 
3909
#-------------------------------------------------------------------------------
4058
#-------------------------------------------------------------------------------
3910
# Function        : saneLabel
4059
# Function        : saneLabel
3911
#
4060
#
3912
# Description     : Generate a sane version label
4061
# Description     : Generate a sane version label
3913
#                   Handle suplicates (due to character squishing)
4062
#                   Handle duplicates (due to character squishing)
3914
#                   Cache results for repeatability
4063
#                   Cache results for repeatability
3915
#
4064
#
3916
# Inputs          : $entry          - Version info
4065
# Inputs          : $entry          - Version info
3917
#                   $pkgname        - Alternate pkgname (branching)
4066
#                   $pkgname        - Alternate pkgname (branching)
3918
#
4067
#