Subversion Repositories DevTools

Rev

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

Rev 2403 Rev 2412
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 68... Line 69...
68
my $opt_vobMap;
69
my $opt_vobMap;
69
my $opt_preserveProjectBase;
70
my $opt_preserveProjectBase;
70
my $opt_ignoreProjectBaseErrors;
71
my $opt_ignoreProjectBaseErrors;
71
my $opt_delete;
72
my $opt_delete;
72
my $opt_recentAge = 14;             # Days
73
my $opt_recentAge = 14;             # Days
73
my $opt_relabel = 1;
74
my $opt_relabel = 0;
74
 
75
 
75
################################################################################
76
################################################################################
76
#   List of Projects Suffixes and Branch Names to be used within SVN
77
#   List of Projects Suffixes and Branch Names to be used within SVN
77
#
78
#
78
#       Name        - Name of branch for the project
79
#       Name        - Name of branch for the project
Line 278... Line 279...
278
my $svnRepo;
279
my $svnRepo;
279
my $processCount = 0;
280
my $processCount = 0;
280
my $processTotal = 0;
281
my $processTotal = 0;
281
my $recentCount = 0;
282
my $recentCount = 0;
282
my $packageReLabelCount = 0;
283
my $packageReLabelCount = 0;
-
 
284
my %saneLabels;
283
 
285
 
284
our $GBE_RM_URL;
286
our $GBE_RM_URL;
285
my $UNIX = $ENV{'GBE_UNIX'};
287
my $UNIX = $ENV{'GBE_UNIX'};
286
 
288
 
287
my $result = GetOptions (
289
my $result = GetOptions (
Line 1859... Line 1861...
1859
        if ( $rv )
1861
        if ( $rv )
1860
        {
1862
        {
1861
            $data->{errStr} = 'Failed to convert filenames to UTF8';
1863
            $data->{errStr} = 'Failed to convert filenames to UTF8';
1862
            return 14;
1864
            return 14;
1863
        }
1865
        }
-
 
1866
 
-
 
1867
        #
-
 
1868
        #   Check to see if our ViewPath has been changed
-
 
1869
        #   If so, then try to fix it
-
 
1870
        #
-
 
1871
        unless ( -d $data->{ViewPath} )
-
 
1872
        {
-
 
1873
            Message ("Correct UTF-8 change to ViewPath");
-
 
1874
            $data->{ViewPath} = encode('UTF-8', $data->{ViewPath}, Encode::FB_DEFAULT);
-
 
1875
            Warning ("Correct UTF-8 change to ViewPath - FAILED") unless ( -d $data->{ViewPath} );
-
 
1876
        }
1864
    }
1877
    }
1865
    
1878
    
1866
 
-
 
1867
    #
1879
    #
1868
    #   Have a CC view
1880
    #   Have a CC view
1869
    #   Now we can create the SVN package and branching point before we
1881
    #   Now we can create the SVN package and branching point before we
1870
    #   import the CC data into SVN
1882
    #   import the CC data into SVN
1871
    #
1883
    #
Line 2671... Line 2683...
2671
        }
2683
        }
2672
    }
2684
    }
2673
    return $me;
2685
    return $me;
2674
}
2686
}
2675
 
2687
 
-
 
2688
#-------------------------------------------------------------------------------
-
 
2689
# Function        : saneLabel
-
 
2690
#
-
 
2691
# Description     : Generate a sane version label
-
 
2692
#                   Handle suplicates (due to character squishing)
-
 
2693
#                   Cache results for repeatability
-
 
2694
#
-
 
2695
# Inputs          : $entry          - Version info
-
 
2696
#                   $pkgname        - Alternate pkgname (branching)
-
 
2697
#
-
 
2698
# Returns         : Sane string
-
 
2699
#
2676
sub saneLabel
2700
sub saneLabel
2677
{
2701
{
2678
    my ($entry, $pkgname) = @_;
2702
    my ($entry, $pkgname) = @_;
2679
    my $me;
2703
    my $me;
2680
    $me = $versions{$entry}{vname};
2704
    $me = $versions{$entry}{vname};
2681
    $pkgname = $versions{$entry}{name} unless ( defined $pkgname );
2705
    $pkgname = $versions{$entry}{name} unless ( defined $pkgname );
2682
 
2706
 
-
 
2707
    #
-
 
2708
    #   If we have calculated it, then reuse it.
-
 
2709
    #
-
 
2710
    if ( exists $versions{$entry}{saneLabel}{$pkgname} )
-
 
2711
    {
-
 
2712
        return $versions{$entry}{saneLabel}{$pkgname};
-
 
2713
    }
-
 
2714
 
-
 
2715
 
2683
    Error ("Package does have a version string: pvid: $entry")
2716
    Error ("Package does have a version string: pvid: $entry")
2684
        unless ( defined $me );
2717
        unless ( defined $me );
2685
 
2718
 
2686
    #
2719
    #
2687
    #   Convert Wip format (xxxx) into a string that can be used for a label
2720
    #   Convert Wip format (xxxx) into a string that can be used for a label
Line 2701... Line 2734...
2701
    $me = $pkgname . '_' . $me;
2734
    $me = $pkgname . '_' . $me;
2702
    $me =~ tr~ ~-~s;
2735
    $me =~ tr~ ~-~s;
2703
    $me =~ tr~-~-~s;
2736
    $me =~ tr~-~-~s;
2704
    $me =~ tr~_~_~s;
2737
    $me =~ tr~_~_~s;
2705
 
2738
 
-
 
2739
    #
-
 
2740
    #   Due to some sillyness ( package version starting with _ )
-
 
2741
    #   we may get duplicates. Detect and allocate different numbers
-
 
2742
    #
-
 
2743
    if ( exists $saneLabels{$me} )
-
 
2744
    {
-
 
2745
        $saneLabels{$me}++;
-
 
2746
        $me = $me . '.' . $saneLabels{$me};
-
 
2747
        Message ("Duplicate SaneLabel resolved as: $me");
-
 
2748
    }
-
 
2749
    else
-
 
2750
    {
-
 
2751
        $saneLabels{$me} = 0;
-
 
2752
    }
-
 
2753
 
-
 
2754
    #
-
 
2755
    #   Cache value
-
 
2756
    #
-
 
2757
    $versions{$entry}{saneLabel}{$pkgname} = $me;
2706
    return $me;
2758
    return $me;
2707
}
2759
}
2708
 
2760
 
2709
sub saneString
2761
sub saneString
2710
{
2762
{
Line 3741... Line 3793...
3741
        }
3793
        }
3742
        
3794
        
3743
        #print "ESSENTIAL: $versions{$_}{name} $versions{$_}{vname}\n";
3795
        #print "ESSENTIAL: $versions{$_}{name} $versions{$_}{vname}\n";
3744
    }
3796
    }
3745
 
3797
 
3746
 
-
 
3747
    #
3798
    #
3748
    #   Free memory
3799
    #   Free memory
3749
    #
3800
    #
3750
    %ScmReleases = ();
3801
    %ScmReleases = ();
3751
    %ScmPackages = ();
3802
    %ScmPackages = ();