Subversion Repositories DevTools

Rev

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

Rev 2354 Rev 2393
Line 156... Line 156...
156
    'daf_utils_mos'       => ',flat,',
156
    'daf_utils_mos'       => ',flat,',
157
    'mos_packager'        => ',all,',
157
    'mos_packager'        => ',all,',
158
    'cfmgr-cfmgr'         => ',flat,',
158
    'cfmgr-cfmgr'         => ',flat,',
159
    'daf_utils_button_st' => ',flat,',
159
    'daf_utils_button_st' => ',flat,',
160
    'ReleaseName'         => ',flat,',
160
    'ReleaseName'         => ',flat,',
-
 
161
    'reports'             => ',utf8,',
161
 
162
 
162
    # Need to be handled in a special manner
163
    # Need to be handled in a special manner
163
    # Not done by this utility
164
    # Not done by this utility
164
    #
165
    #
165
    'linux_drivers_eb5600'  => ',protected,',
166
    'linux_drivers_eb5600'  => ',protected,',
Line 259... Line 260...
259
my $allSvn;
260
my $allSvn;
260
my @multiplePaths;
261
my @multiplePaths;
261
my @badEssentials;
262
my @badEssentials;
262
my %svnData;
263
my %svnData;
263
my $cwd;
264
my $cwd;
-
 
265
my $mustConvertFileNames;
264
 
266
 
265
my $packageNames;
267
my $packageNames;
266
my @packageNames;
268
my @packageNames;
267
my $multiPackages = -1;
269
my $multiPackages = -1;
268
my $visitId = 0;
270
my $visitId = 0;
Line 605... Line 607...
605
    }
607
    }
606
 
608
 
607
    #
609
    #
608
    #   Some packages are special
610
    #   Some packages are special
609
    #
611
    #
-
 
612
    if ( $svnRepo =~ m~/Manufacturing(/|$)~ )
-
 
613
    {
-
 
614
        Message ("Set Manufacturing Repo style");
-
 
615
        $opt_flat = 1;
-
 
616
        setPruneMode('none') unless (defined $opt_pruneModeString);
-
 
617
    }
-
 
618
 
610
 
619
 
611
    if ( $packageNames[0] =~ m'^br_applet_' )
620
    if ( $packageNames[0] =~ m'^br_applet_' )
612
    {
621
    {
613
        $opt_flat = 1 unless defined $opt_flat;
622
      $opt_flat = 1 unless defined $opt_flat;
614
    }
623
    }
615
 
624
 
616
    foreach  ( @excludeFromImport )
625
    foreach  ( @excludeFromImport )
617
    {
626
    {
618
         $specialPackages{$_} .= 'protected,';
627
         $specialPackages{$_} .= 'protected,';
Line 642... Line 651...
642
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
651
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
643
            $opt_ignoreProjectBaseErrors = 1;
652
            $opt_ignoreProjectBaseErrors = 1;
644
            Message ("Ignore ProjectBase Errors");
653
            Message ("Ignore ProjectBase Errors");
645
        }
654
        }
646
 
655
 
-
 
656
        if ( index( $data, 'utf8,' ) >= 0) {
-
 
657
            $mustConvertFileNames = 1;
-
 
658
            Message ("Convert filenames to UTF8");
-
 
659
        }
647
    }
660
    }
648
 
661
 
649
    Message("Package Type: $packageType, $pruneModeString");
662
    Message("Package Type: $packageType, $pruneModeString");
650
}
663
}
651
 
664
 
Line 1864... Line 1877...
1864
            Message ("Adjust Base Dir: $testDir");
1877
            Message ("Adjust Base Dir: $testDir");
1865
            $data->{adjustedPath} = $data->{ViewPath};
1878
            $data->{adjustedPath} = $data->{ViewPath};
1866
            $data->{ViewPath} = $testDir;
1879
            $data->{ViewPath} = $testDir;
1867
        }
1880
        }
1868
    }
1881
    }
-
 
1882
 
-
 
1883
    #
-
 
1884
    #   Some packages have filenames that are need to be converted
-
 
1885
    #
-
 
1886
    if ( $mustConvertFileNames  )
-
 
1887
    {
-
 
1888
        $rv = system ( '/home/dpurdie/svn/tools/convmv-1.15/convmv',
-
 
1889
                 '-fiso-8859-1',
-
 
1890
                 '-tutf8',
-
 
1891
                 '-r',
-
 
1892
                 '--notest',
-
 
1893
                 $data->{ViewPath} );
-
 
1894
 
-
 
1895
        if ( $rv )
-
 
1896
        {
-
 
1897
            $data->{errStr} = 'Failed to convert filenames to UTF8';
-
 
1898
            return 14;
-
 
1899
        }
-
 
1900
    }
1869
    
1901
    
1870
 
1902
 
1871
    #
1903
    #
1872
    #   Have a CC view
1904
    #   Have a CC view
1873
    #   Now we can create the SVN package and branching point before we
1905
    #   Now we can create the SVN package and branching point before we
Line 2699... Line 2731...
2699
    connectRM(\$RM_DB) unless ( $RM_DB );
2731
    connectRM(\$RM_DB) unless ( $RM_DB );
2700
 
2732
 
2701
    #
2733
    #
2702
    #   Extract data from Release Manager
2734
    #   Extract data from Release Manager
2703
    #
2735
    #
-
 
2736
    my $m_sqlstr = "SELECT " .
-
 
2737
                       "pkg.PKG_NAME, " .                                       # row[0]
-
 
2738
                       "pv.PKG_VERSION, " .                                     # row[1]
-
 
2739
                       "pkg.PKG_ID, " .                                         # row[2]
-
 
2740
                       "pv.PV_ID, " .                                           # row[3]
-
 
2741
                       "pv.LAST_PV_ID, " .                                      # row[4]
-
 
2742
                       "pv.MODIFIED_STAMP, " .                                  # row[5]
2704
    my $m_sqlstr = "SELECT pkg.PKG_NAME, pv.PKG_VERSION, pkg.PKG_ID, pv.PV_ID, pv.LAST_PV_ID, pv.MODIFIED_STAMP, release_manager.PK_RMAPI.return_vcs_tag(pv.PV_ID), amu.USER_NAME, pv.COMMENTS, pv.DLOCKED, pv.CREATOR_ID ".
2743
                       "release_manager.PK_RMAPI.return_vcs_tag(pv.PV_ID), " .  # row[6]
2705
                   " FROM RELEASE_MANAGER.PACKAGES pkg, RELEASE_MANAGER.PACKAGE_VERSIONS pv, ACCESS_MANAGER.USERS amu" .
2744
                       "amu.USER_NAME, " .                                      # row[7]
-
 
2745
                       "pv.COMMENTS, " .                                        # row[8]
-
 
2746
                       "pv.DLOCKED, " .                                         # row[9]
-
 
2747
                       "pv.CREATOR_ID, ".                                       # row[10]
2706
                   " WHERE pv.PKG_ID = \'$pkg_id\' AND pkg.PKG_ID = pv.PKG_ID AND amu.USER_ID (+) = pv.CREATOR_ID";
2748
                       "pv.BUILD_TYPE ".                                        # row[11]
2707
                   
2749
                   " FROM " .
-
 
2750
                        "RELEASE_MANAGER.PACKAGES pkg, " .
-
 
2751
                        "RELEASE_MANAGER.PACKAGE_VERSIONS pv, " .
-
 
2752
                        "ACCESS_MANAGER.USERS amu" .
2708
                   
2753
                   " WHERE " .
-
 
2754
                        "pv.PKG_ID = \'$pkg_id\' " .
-
 
2755
                        "AND pkg.PKG_ID = pv.PKG_ID " .
-
 
2756
                        "AND amu.USER_ID (+) = pv.CREATOR_ID";
-
 
2757
 
2709
    my $sth = $RM_DB->prepare($m_sqlstr);
2758
    my $sth = $RM_DB->prepare($m_sqlstr);
2710
    if ( defined($sth) )
2759
    if ( defined($sth) )
2711
    {
2760
    {
2712
        if ( $sth->execute( ) )
2761
        if ( $sth->execute( ) )
2713
        {
2762
        {
Line 2726... Line 2775...
2726
                    my $vcstag =  $row[6] || 'Unknown';
2775
                    my $vcstag =  $row[6] || 'Unknown';
2727
 
2776
 
2728
                    my $created_id =  $row[7] || ($row[10] ? "Userid_$row[10]" :'Unknown');
2777
                    my $created_id =  $row[7] || ($row[10] ? "Userid_$row[10]" :'Unknown');
2729
                    my $comment =  $row[8] || '';
2778
                    my $comment =  $row[8] || '';
2730
                    my $locked =  $row[9] || 'N';
2779
                    my $locked =  $row[9] || 'N';
-
 
2780
                    my $manual = $row[11] || 'M';
2731
 
2781
 
2732
                    #
2782
                    #
2733
                    #   Some developers have a 'special' package version
2783
                    #   Some developers have a 'special' package version
2734
                    #   We really need to ignore them
2784
                    #   We really need to ignore them
2735
                    #
2785
                    #
Line 2749... Line 2799...
2749
                    $versions{$pv_id}{comment} = $comment;
2799
                    $versions{$pv_id}{comment} = $comment;
2750
                    $versions{$pv_id}{locked} = $locked;
2800
                    $versions{$pv_id}{locked} = $locked;
2751
                    $versions{$pv_id}{TimeStamp} = str2time( $created );
2801
                    $versions{$pv_id}{TimeStamp} = str2time( $created );
2752
                    $versions{$pv_id}{Age} = ($now - $versions{$pv_id}{TimeStamp}) / (60 * 60 * 24);
2802
                    $versions{$pv_id}{Age} = ($now - $versions{$pv_id}{TimeStamp}) / (60 * 60 * 24);
2753
                    $versions{$pv_id}{TooOld} = 1 if ( $opt_age && $opt_age <= $versions{$pv_id}{Age} );
2803
                    $versions{$pv_id}{TooOld} = 1 if ( $opt_age && $opt_age <= $versions{$pv_id}{Age} );
-
 
2804
                    $versions{$pv_id}{BuildType} = $manual;
2754
                    examineVcsTag($pv_id);
2805
                    examineVcsTag($pv_id);
2755
 
2806
 
2756
                    #
2807
                    #
2757
                    #   Process version number
2808
                    #   Process version number
2758
                    #
2809
                    #
2759
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion ) = massageVersion($pkg_ver, $pkg_name);
2810
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion ) = massageVersion($pkg_ver, $pkg_name);
2760
 
2811
 
2761
                    $versions{$pv_id}{version} = $version;
2812
                    $versions{$pv_id}{version} = $version;
2762
                    $versions{$pv_id}{buildVersion} = $buildVersion;
2813
                    $versions{$pv_id}{buildVersion} = $buildVersion;
2763
                    $versions{$pv_id}{isaRipple} = 1 if ( $isaR );
-
 
2764
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
2814
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
2765
 
2815
 
2766
                    #
2816
                    #
-
 
2817
                    #   New methof for detecting a ripple
-
 
2818
                    #       Don't look at the version number
-
 
2819
                    #       Use RM data
-
 
2820
                    #       Inlude the comment - there are some cases where the comment
-
 
2821
                    #       appears to have been user modified.
-
 
2822
                    #
-
 
2823
#                    $versions{$pv_id}{isaRipple} = 1 if ( $isaR );
-
 
2824
#                    $versions{$pv_id}{isaRipple} = 1 if ( uc($manual) eq 'Y' );
-
 
2825
                    $versions{$pv_id}{isaRipple} = ( $comment =~ m~^Rippled Build~i && ( uc($manual) eq 'Y' ));
-
 
2826
 
-
 
2827
                    #
2767
                    #   Process suffix
2828
                    #   Process suffix
2768
                    #
2829
                    #
2769
                    $suffix = 'Unknown' unless ( $suffix );
2830
                    $suffix = 'Unknown' unless ( $suffix );
2770
                    $suffix = lc ($suffix);
2831
                    $suffix = lc ($suffix);
2771
                    $versions{$pv_id}{suffix} = $suffix;
2832
                    $versions{$pv_id}{suffix} = $suffix;