Subversion Repositories DevTools

Rev

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

Rev 2909 Rev 2930
Line 85... Line 85...
85
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
85
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
86
my $opt_resume;
86
my $opt_resume;
87
my $opt_processRipples = 1;
87
my $opt_processRipples = 1;
88
my $opt_mergePackages;
88
my $opt_mergePackages;
89
my @opt_deleteFiles;
89
my @opt_deleteFiles;
-
 
90
my $opt_useTestRepo;
90
 
91
 
91
################################################################################
92
################################################################################
92
#   List of Projects Suffixes and Branch Names to be used within SVN
93
#   List of Projects Suffixes and Branch Names to be used within SVN
93
#
94
#
94
#       Name        - Name of branch for the project
95
#       Name        - Name of branch for the project
Line 282... Line 283...
282
    'linux_day0fs_gen1'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
283
    'linux_day0fs_gen1'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
283
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
284
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
284
                                       ',processRipples',
285
                                       ',processRipples',
285
 
286
 
286
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
287
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
-
 
288
 
-
 
289
    'serpent'                         => 'flatTime,processRipples,LimitProjectBase=/LMOS/linux/kernel'.
-
 
290
                                         ',mergePaths=serpent-common:common:cobra:viper',
-
 
291
 
287
    'rt3070'                          => 'flatVersion',
292
    'rt3070'                          => 'flatVersion',
288
 
293
 
289
    'TRACS'                           => 'IgnoreMakeProject,DeleteFiles=*.plg',   # not tested
294
    'TRACS'                           => 'IgnoreMakeProject,DeleteFiles=*.plg',   # not tested
290
 
295
 
291
 
296
 
Line 306... Line 311...
306
    'linux_kernel_gen1' => {
311
    'linux_kernel_gen1' => {
307
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
312
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
308
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
313
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
309
            },
314
            },
310
 
315
 
-
 
316
    'serpent'   => {
-
 
317
        'linux_kernel_viper_2.6.24.6.0000.cots' => 'common:viper',
-
 
318
        'linux_kernel_viper_2.6.24.6.1000.cots' => 'serpent-common:cobra:viper',
-
 
319
 
-
 
320
    },
-
 
321
 
-
 
322
);
-
 
323
 
-
 
324
my %packageRippleControl = (
-
 
325
    'linux_drivers_etx86' => 'major',
-
 
326
    'linux_drivers_eb5600' => 'major',
-
 
327
    'linux_drivers_tp5600' => 'major',
311
);
328
);
312
 
329
 
313
 
330
 
314
my %notCots = (
331
my %notCots = (
315
    'isl'       => 1,
332
    'isl'       => 1,
Line 320... Line 337...
320
    '14503'     => { name => 'Hops3' },
337
    '14503'     => { name => 'Hops3' },
321
    '21864'     => { name => 'Hops3.6' },
338
    '21864'     => { name => 'Hops3.6' },
322
    '22303'     => { name => 'Hops3.7' },
339
    '22303'     => { name => 'Hops3.7' },
323
    '17223'     => { name => 'Hops4' },
340
    '17223'     => { name => 'Hops4' },
324
 
341
 
325
    '19743' => {name => 'ITSO.2.1.4-MainlineOBE_Validator'},
342
#    '19743' => {name => 'ITSO.2.1.4-MainlineOBE_Validator'},
326
    '11743' => {name => 'ITSO.2.1.3-MainlineOBE_Validator'},
343
#    '11743' => {name => 'ITSO.2.1.3-MainlineOBE_Validator'},
327
    '21384' => {name => 'OBE2.1.3-GoAheadRelease-R4'},
344
#    '21384' => {name => 'OBE2.1.3-GoAheadRelease-R4'},
328
    '23243' => {name => 'OBE2.1.3-GoAheadRelease-R4.5'},
345
#    '23243' => {name => 'OBE2.1.3-GoAheadRelease-R4.5'},
329
    '23843' => {name => 'Validator.2.1.3-UKlive'},
346
#    '23843' => {name => 'Validator.2.1.3-UKlive'},
330
    '15663' => {name => 'Validator.2.1.3-LegacyVersion_SSW_LMR'},
347
#    '15663' => {name => 'Validator.2.1.3-LegacyVersion_SSW_LMR'},
331
    '25183' => {name => 'ITSO.2.1.4-Validator-cmnITSO.V2src'},
348
#    '25183' => {name => 'ITSO.2.1.4-Validator-cmnITSO.V2src'},
332
    '24303' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.4'},
349
#    '24303' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.4'},
333
    '13143' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2'},
350
#    '13143' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2'},
334
    '24443' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2-hot-fix'},
351
#    '24443' => {name => 'OBME_PSION-MAINLINE-ITSO.2.1.2-hot-fix'},
335
    '16023' => {name => 'OBME_PSION-TransportScotlandDLL'},
352
#    '16023' => {name => 'OBME_PSION-TransportScotlandDLL'},
336
 
353
 
337
);
354
);
338
 
355
 
339
# The following packages will have the version in the specified release forced to be on the trunk
356
# The following packages will have the version in the specified release forced to be on the trunk
340
# A trunk will be forced and the version will be on it.
357
# A trunk will be forced and the version will be on it.
Line 433... Line 450...
433
                'postimage!'        => \$opt_postimage,
450
                'postimage!'        => \$opt_postimage,
434
                'workdir:s'         => \$opt_workDir,
451
                'workdir:s'         => \$opt_workDir,
435
                'relabel!'          => \$opt_relabel,
452
                'relabel!'          => \$opt_relabel,
436
                'svn!'              => \$opt_useSvn,
453
                'svn!'              => \$opt_useSvn,
437
                'testRmDatabase'    => \$opt_testRmDatabase,
454
                'testRmDatabase'    => \$opt_testRmDatabase,
438
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
439
                'resume'            => \$opt_resume,
455
                'resume'            => \$opt_resume,
440
                'mergePackages:s'   => \$opt_mergePackages,
456
                'mergePackages:s'   => \$opt_mergePackages,
441
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
457
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
442
                
-
 
443
                'svn!'          => \$opt_useSvn,
-
 
444
                'testRmDatabase'    => \$opt_testRmDatabase,
-
 
445
                'fromSvn!'          => \$opt_extractFromSvn,
458
                'fromSvn!'          => \$opt_extractFromSvn,
-
 
459
                'testRepo!'         => \$opt_useTestRepo,
446
                );
460
                );
447
 
461
 
448
#
462
#
449
#   Process help and manual options
463
#   Process help and manual options
450
#
464
#
Line 538... Line 552...
538
                    linux_kernel_tp5600
552
                    linux_kernel_tp5600
539
                    linux_kernel_eb5600
553
                    linux_kernel_eb5600
540
                    linux_kernel_bcp4600
554
                    linux_kernel_bcp4600
541
                );
555
                );
542
 
556
 
-
 
557
    } elsif ( $opt_mergePackages eq 'serpent' ) {
-
 
558
        $opt_name = $opt_mergePackages;
-
 
559
        @ARGV = qw (
-
 
560
                    linux_kernel_viper
-
 
561
                    linux_kernel_cobra
-
 
562
                );
543
    } else
563
    } else
544
    {
564
    {
545
        Error ("Unknown Merge Package Name: $opt_mergePackages");
565
        Error ("Unknown Merge Package Name: $opt_mergePackages");
546
    }
566
    }
547
}
567
}
Line 913... Line 933...
913
            Message ("Flatten import tree. Sort by Version");
933
            Message ("Flatten import tree. Sort by Version");
914
            $opt_flat = 1;
934
            $opt_flat = 1;
915
            $flatMode = 2;          # By Version
935
            $flatMode = 2;          # By Version
916
            $opt_processRipples = 0;
936
            $opt_processRipples = 0;
917
        }
937
        }
918
        
-
 
919
 
938
 
920
        if ( index( $data, ',processRipples,' ) >= 0) {
939
        if ( index( $data, ',processRipples,' ) >= 0) {
921
            $opt_processRipples = 1;
940
            $opt_processRipples = 1;
922
        }
941
        }
923
 
942
 
Line 1778... Line 1797...
1778
    {
1797
    {
1779
        my $ep = $versions{$entry};
1798
        my $ep = $versions{$entry};
1780
        if ( defined $ep->{buildVersion} )
1799
        if ( defined $ep->{buildVersion} )
1781
        {
1800
        {
1782
            my $suffix = $ep->{suffix};
1801
            my $suffix = $ep->{suffix};
-
 
1802
            my $pname = $ep->{name};
-
 
1803
            $suffix = $pname . $suffix;
-
 
1804
 
1783
            my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
1805
            my ($major, $minor, $patch, $build) = @{$ep->{buildVersion}};
1784
#print "--- $major, $minor, $patch, $build, $suffix\n";
1806
#print "--- $major, $minor, $patch, $build, $suffix\n";
-
 
1807
 
-
 
1808
            my $key;
-
 
1809
            my $type = 'patch';
-
 
1810
            $type = $packageRippleControl{$pname} if ( exists  $packageRippleControl{$pname});
-
 
1811
            if ( $type eq 'patch' ) {
-
 
1812
                $key = "$major.$minor.$patch";
-
 
1813
#                $build = $build;
-
 
1814
 
-
 
1815
            } elsif ( $type eq 'minor' ) {
-
 
1816
                $key = "$major.$minor";
-
 
1817
#                $build = ($patch * 1000) + $build;
-
 
1818
 
-
 
1819
            } elsif ( $type eq 'major' ) {
-
 
1820
                $key = "$major";
-
 
1821
#                $build = ($minor * 1000000) + ($patch * 1000) + $build;
-
 
1822
            } else {
-
 
1823
                Error ("Invalid type in packageRippleControl for package $pname: $type");
-
 
1824
            }
-
 
1825
 
1785
            $rippleVersions{$suffix}{"$major.$minor.$patch"}{count}++;
1826
            $rippleVersions{$suffix}{$key}{count}++;
1786
            my $rp = $rippleVersions{$suffix}{"$major.$minor.$patch"};
1827
            my $rp = $rippleVersions{$suffix}{$key};
1787
            $rp->{list}{$entry} = 1;
1828
            $rp->{list}{$entry} = $versions{$entry}{version};
1788
 
1829
 
1789
            next if ( $ep->{badVcsTag} );
1830
#            next if ( $ep->{badVcsTag} );
1790
            next if ( $ep->{locked} eq 'N');
1831
#            next if ( $ep->{locked} eq 'N');
-
 
1832
 
1791
            if (!defined ($rp->{min}) || $rp->{min} > $build )
1833
#            if (!defined ($rp->{min}) || $rp->{min} > $build )
1792
            {
1834
#            {
1793
                $rp->{pvid} = $entry;
1835
#                $rp->{pvid} = $entry;
1794
                $rp->{min} = $build;
1836
#                $rp->{min} = $build;
1795
            }
1837
#            }
1796
        }
1838
        }
1797
    }
1839
    }
1798
#            DebugDumpData("rippleVersions", \%rippleVersions );
1840
#            DebugDumpData("rippleVersions", \%rippleVersions );
1799
 
1841
 
1800
    while ( my($suffix, $e1) = each %rippleVersions )
1842
    while ( my($suffix, $e1) = each %rippleVersions )
1801
    {
1843
    {
-
 
1844
#DebugDumpData("rippleVersions. Suffix , e1", $suffix, $e1 );
-
 
1845
        
1802
        while ( my( $mmp, $e2) = each %{$e1} )
1846
        while ( my( $mmp, $e2) = each %{$e1} )
1803
        {
1847
        {
1804
            next unless ( exists  $e2->{pvid} );
1848
#            next unless ( exists  $e2->{pvid} );
1805
            my $entry = $e2->{pvid};
1849
#            my $entry = $e2->{pvid};
1806
            if ( !exists $versions{$entry} )
1850
#            if ( !exists $versions{$entry} )
1807
            {
1851
#            {
1808
                Error ("Internal: Expected entry not found: $entry, $mmp");
1852
#                Error ("Internal: Expected entry not found: $entry, $mmp");
1809
            }
1853
#            }
1810
 
1854
#
1811
            $versions{$entry}{keepLowestRipple} = 1;
1855
#            $versions{$entry}{keepLowestRipple} = 1;
1812
#print "--- Keep Riple $versions{$entry}{vname}\n";
1856
#print "--- Keep Ripple: $versions{$entry}{name} $versions{$entry}{vname}\n";
1813
 
1857
 
1814
            #
1858
            #
1815
            #   Update entry with list of associated ripples, removing lowest
1859
            #   Update entry with list of associated ripples, removing lowest
1816
            #
1860
            #
-
 
1861
            my @rippleList = sort {$e2->{list}{$a} cmp $e2->{list}{$b}} keys %{$e2->{list}};
1817
            delete $e2->{list}{$entry};
1862
            my $firstEntry = shift @rippleList;
1818
            my @rippleList = sort keys %{$e2->{list}};
1863
            $versions{$firstEntry}{keepLowestRipple} = 1;
-
 
1864
#print "--- Keep Lowest: $versions{$firstEntry}{name} $versions{$firstEntry}{vname}\n";
-
 
1865
 
1819
            if ( @rippleList)
1866
            if ( @rippleList)
1820
            {
1867
            {
1821
#DebugDumpData("LIST: $entry", $e2->{list}, \@rippleList  );
1868
#DebugDumpData("LIST: $entry", $e2->{list}, \@rippleList  );
1822
                @{$versions{$entry}{rippleList}} = @rippleList;
1869
                @{$versions{$firstEntry}{rippleList}} = @rippleList;
-
 
1870
 
-
 
1871
#                foreach my $pvid ( @rippleList )
-
 
1872
#                {
-
 
1873
#                    print "----- $versions{$pvid}{name} $versions{$pvid}{vname}\n";
-
 
1874
#                }
1823
            }
1875
            }
1824
        }
1876
        }
1825
    }
1877
    }
-
 
1878
#    Error ("Just Testing");
1826
}
1879
}
1827
 
1880
 
1828
#-------------------------------------------------------------------------------
1881
#-------------------------------------------------------------------------------
1829
# Function        : processBranch
1882
# Function        : processBranch
1830
#
1883
#
Line 3069... Line 3122...
3069
 
3122
 
3070
    #
3123
    #
3071
    #   Create a nice name for the import
3124
    #   Create a nice name for the import
3072
    #
3125
    #
3073
    my $import_label = saneLabel($entry);
3126
    my $import_label = saneLabel($entry);
3074
    
-
 
3075
 
3127
 
3076
    $data->{ViewRoot} = $opt_name ? $opt_name : $import_label;
3128
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : $import_label;
3077
    $data->{ViewPath} =  $data->{ViewRoot};
3129
    $data->{ViewPath} =  $data->{ViewRoot};
3078
    $data->{ViewPath} =~  tr~/~/~s;
3130
    $data->{ViewPath} =~  tr~/~/~s;
3079
 
3131
    
3080
    if ( $opt_reuse && -d $data->{ViewPath}  )
3132
    if ( $opt_reuse && -d $data->{ViewPath}  )
3081
    {
3133
    {
3082
        Message ("Reusing view: $import_label");
3134
        Message ("Reusing view: $import_label");
3083
        return 0;
3135
        return 0;
3084
    }
3136
    }
Line 3910... Line 3962...
3910
                    #
3962
                    #
3911
                    #   Some developers have a 'special' package version
3963
                    #   Some developers have a 'special' package version
3912
                    #   We really need to ignore them
3964
                    #   We really need to ignore them
3913
                    #
3965
                    #
3914
                    next if ( $pkg_ver eq '23.23.23.ssw' );
3966
                    next if ( $pkg_ver eq '23.23.23.ssw' );
3915
                    
-
 
-
 
3967
 
3916
                    #
3968
                    #
3917
                    #   Add data to the hash
3969
                    #   Add data to the hash
3918
                    #       Remove entries that address themselves
3970
                    #       Remove entries that address themselves
3919
                    #
3971
                    #
3920
                    push (@{$versions{$last_pv_id}{next}}, $pv_id) unless ($pv_id == $last_pv_id || $last_pv_id == 0) ;
3972
                    push (@{$versions{$last_pv_id}{next}}, $pv_id) unless ($pv_id == $last_pv_id || $last_pv_id == 0) ;
Line 4741... Line 4793...
4741
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4793
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4742
        if (exists $ScmRepoMap{$packageNames});
4794
        if (exists $ScmRepoMap{$packageNames});
4743
 
4795
 
4744
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4796
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4745
        if (exists $ScmRepoMap{$packageNames}{protected});
4797
        if (exists $ScmRepoMap{$packageNames}{protected});
-
 
4798
 
-
 
4799
    $opt_vobMap = '' if ( $opt_repoSubdir );
-
 
4800
 
4746
    #
4801
    #
4747
    #   Free the memory
4802
    #   Free the memory
4748
    #
4803
    #
4749
    %ScmRepoMap = ();
4804
    %ScmRepoMap = ();
4750
 
4805
 
4751
    #
4806
    #
4752
    #   Calculate Target Repo
4807
    #   Calculate Target Repo
4753
    #
4808
    #
4754
    Warning ("No VOB Mapping found")
4809
    Warning ("No VOB Mapping found")
4755
        unless ($opt_vobMap);
4810
        unless ($opt_vobMap || ($opt_repoSubdir && $opt_repo));
4756
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4811
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4757
        unless ( $opt_repo || $opt_vobMap );
4812
        unless ( $opt_repo || $opt_vobMap );
4758
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
4813
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
-
 
4814
    $r1 = 'Import_test/' . $r1 if ( $opt_useTestRepo );
4759
    $r1 =~ s~//~/~g;
4815
    $r1 =~ s~//~/~g;
4760
    $r1 =~ s~^/~~;
4816
    $r1 =~ s~^/~~;
4761
    $r1 =~ s~/$~~;
4817
    $r1 =~ s~/$~~;
4762
    $svnRepo = $opt_repo_base . $r1;
4818
    $svnRepo = $opt_repo_base . $r1;
4763
 
4819
 
Line 4976... Line 5032...
4976
        } elsif ( $entry->{fromPath} =~ m~/branches/(.*)~ ) {
5032
        } elsif ( $entry->{fromPath} =~ m~/branches/(.*)~ ) {
4977
            $fromBranch = $1;
5033
            $fromBranch = $1;
4978
        }
5034
        }
4979
 
5035
 
4980
        # largest Rev number on branch
5036
        # largest Rev number on branch
4981
        if ( exists $svnData{max}{$fromBranch} )
5037
        if ( exists $svnData{max} && exists $svnData{max}{$fromBranch} )
4982
        {
5038
        {
4983
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{fromRev} )
5039
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{fromRev} )
4984
            {
5040
            {
4985
                $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
5041
                $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
4986
                $svnData{max}{$fromBranch}{name} = $name;
5042
                $svnData{max}{$fromBranch}{name} = $name;
Line 5196... Line 5252...
5196
    -workdir=path      - Use for temp storage (def:/work)
5252
    -workdir=path      - Use for temp storage (def:/work)
5197
    -delete            - Delete SVN package before test
5253
    -delete            - Delete SVN package before test
5198
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
5254
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
5199
    -testRmDatabase    - Use test database
5255
    -testRmDatabase    - Use test database
5200
    -[no]fromSvn       - Also extract packages from SVN
5256
    -[no]fromSvn       - Also extract packages from SVN
-
 
5257
    -[no]testRepo      - Force use of a test repository.
5201
 
5258
 
5202
=head1 OPTIONS
5259
=head1 OPTIONS
5203
 
5260
 
5204
=over 8
5261
=over 8
5205
 
5262