Subversion Repositories DevTools

Rev

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

Rev 2026 Rev 2429
Line 39... Line 39...
39
use Fcntl ':flock'; # import LOCK_* constants
39
use Fcntl ':flock'; # import LOCK_* constants
40
use Cwd;
40
use Cwd;
41
use DBI;
41
use DBI;
42
use Getopt::Long;
42
use Getopt::Long;
43
use Pod::Usage;                             # required for help support
43
use Pod::Usage;                             # required for help support
-
 
44
use Encode;
44
 
45
 
45
#
46
#
46
#   Options
47
#   Options
47
#
48
#
48
my $opt_help = 0;
49
my $opt_help = 0;
Line 68... Line 69...
68
my $opt_fileList;
69
my $opt_fileList;
69
my $opt_preserveProjectBase;
70
my $opt_preserveProjectBase;
70
my $opt_ignoreProjectBaseErrors;
71
my $opt_ignoreProjectBaseErrors;
71
my $opt_resume;
72
my $opt_resume;
72
my $opt_delete;
73
my $opt_delete;
-
 
74
my $opt_recentAge = 14;             # Days
-
 
75
my $opt_relabel = 1;
73
 
76
 
74
################################################################################
77
################################################################################
75
#   List of Projects Suffixes and Branch Names to be used within SVN
78
#   List of Projects Suffixes and Branch Names to be used within SVN
76
#
79
#
77
#       Name        - Name of branch for the project
80
#       Name        - Name of branch for the project
Line 102... Line 105...
102
    '.uk'       => { Name => 'UkProject' },
105
    '.uk'       => { Name => 'UkProject' },
103
    '.pmb'      => { Name => 'Pietermaritzburg' },
106
    '.pmb'      => { Name => 'Pietermaritzburg' },
104
    '.vps'      => { Name => 'VixPayments' },
107
    '.vps'      => { Name => 'VixPayments' },
105
    '.ncc'      => { Name => 'NSWClubCard' },
108
    '.ncc'      => { Name => 'NSWClubCard' },
106
    '.rm'       => { Name => 'Rome' },
109
    '.rm'       => { Name => 'Rome' },
-
 
110
    '.vss'      => { Name => 'SmartSite' },
107
    'unknown'   => { Name => 'UnknownProject' },
111
    'unknown'   => { Name => 'UnknownProject' },
108
 
112
 
109
    '.ebr'      => { Name => 'eBrio' , Trunk => 1 },
113
    '.ebr'      => { Name => 'eBrio' , Trunk => 1 },
110
    '.mas'      => { Name => 'Mass'  , Trunk => 1 },
114
    '.mas'      => { Name => 'Mass'  , Trunk => 1 },
111
    '.cr'       => { Name => 'Core'  , Trunk => 1 },
115
    '.cr'       => { Name => 'Core'  , Trunk => 1 },
Line 126... Line 130...
126
    '.pxxx.sydddd'  => '.syd',
130
    '.pxxx.sydddd'  => '.syd',
127
    '.oslo'         => '.oso',
131
    '.oslo'         => '.oso',
128
    '.osl'          => '.oso',
132
    '.osl'          => '.oso',
129
);
133
);
130
 
134
 
-
 
135
my @excludeFromImport = (
-
 
136
 
-
 
137
    # 22-Oct-12: Excluded on request from Kasun Sirikumara
-
 
138
    # Pending VSS work
-
 
139
    'agency_website',
-
 
140
    'alx',
-
 
141
    'alx-api',
-
 
142
    'cardholder_website',
-
 
143
    'loginmodule-ad',
-
 
144
    'ols-enquiry',
-
 
145
    'ols-enquiry-api',
-
 
146
    'olsrpc4j',
-
 
147
    'orca-middleware',
-
 
148
    'orca-middleware-api',
-
 
149
    'orca-salesEngine',
-
 
150
    'orca-web-api',
-
 
151
    'orca-web-utils',
-
 
152
    'TestPaymentGateway',
-
 
153
    'tgen4j',
-
 
154
    'web-cd-client',
-
 
155
);
-
 
156
 
131
my %specialPackages = (
157
my %specialPackages = (
132
    'core_devl' =>  ',all,protected,',
158
    'core_devl'           =>  ',all,protected,',
-
 
159
    'daf_utils_mos'       => ',flat,',
133
#    'core_devl' =>  ',all,',
160
    'mos_packager'        => ',all,',
-
 
161
    'cfmgr-cfmgr'         => ',flat,',
134
    'daf_utils_mos' => ',flat,',
162
    'daf_utils_button_st' => ',flat,',
135
    'mos_packager'  => ',all,',
163
    'ReleaseName'         => ',flat,',
-
 
164
    'reports'             => ',utf8,',
-
 
165
    'cda_imports'         => ',utf8,',
-
 
166
    'cdxforms'            => ',utf8,',
-
 
167
    'db_cda'              => ',utf8,',
-
 
168
 
136
 
169
 
137
    # Need to be handled in a special manner
170
    # Need to be handled in a special manner
138
    # Not done by this utility
171
    # Not done by this utility
139
    #
172
    #
140
    'linux_drivers_eb5600'  => ',protected,',
173
    'linux_drivers_eb5600'  => ',protected,',
Line 142... Line 175...
142
    'linux_drivers_cobra'   => ',protected,',
175
    'linux_drivers_cobra'   => ',protected,',
143
    'linux_drivers_bcp4600' => ',protected,',
176
    'linux_drivers_bcp4600' => ',protected,',
144
    'linux_drivers_etx86'   => ',protected,',
177
    'linux_drivers_etx86'   => ',protected,',
145
    'linux_drivers_tp5600'  => ',protected,',
178
    'linux_drivers_tp5600'  => ',protected,',
146
 
179
 
-
 
180
# Not in the ukHops migration at the moment
-
 
181
    'cs'                        => ',protected,',
-
 
182
 
-
 
183
    'DBA-Common'                => ',protected,',
-
 
184
    'DBA-DatabaseInstall'       => ',protected,',
-
 
185
    'DBA-ExternalPerlModules'   => ',protected,',
-
 
186
    'DBA-OraUserBuild'          => ',protected,',
-
 
187
    'DBA-OST'                   => ',protected,',
-
 
188
    'orahops-install'           => ',protected,',
-
 
189
    'orahops-patch'             => ',protected,',
-
 
190
    'orahops-ssw-install'       => ',protected,',
-
 
191
    'orahops-ssw-patch'         => ',protected,',
-
 
192
# End of ukHops migration exclussion
-
 
193
 
147
    'ftp'                   => 'SetProjectBase,',
194
    'ftp'                   => 'SetProjectBase,',
148
 
195
 
149
    'icl'                   => 'IgnoreProjectBase,',
196
    'icl'                   => 'IgnoreProjectBase,',
150
    'itso'                  => 'IgnoreProjectBase,',
197
    'itso'                  => 'IgnoreProjectBase,',
151
    'daf_osa_mos'           => 'IgnoreProjectBase,',
198
    'daf_osa_mos'           => 'IgnoreProjectBase,',
Line 153... Line 200...
153
    'itso_ud'               => 'IgnoreProjectBase,',
200
    'itso_ud'               => 'IgnoreProjectBase,',
154
#    'mos_api'               => 'IgnoreProjectBase,',
201
#    'mos_api'               => 'IgnoreProjectBase,',
155
#    'mos_fonts'             => 'IgnoreProjectBase,',
202
#    'mos_fonts'             => 'IgnoreProjectBase,',
156
#    'sntp'                  => 'IgnoreProjectBase,',
203
#    'sntp'                  => 'IgnoreProjectBase,',
157
#    'time_it'               => 'IgnoreProjectBase,',
204
#    'time_it'               => 'IgnoreProjectBase,',
158
 
-
 
159
);
205
);
160
 
206
 
161
my %notCots = (
207
my %notCots = (
162
    'isl'       => 1,
208
    'isl'       => 1,
163
);
209
);
164
 
210
 
-
 
211
my $ukHopsMode = 0;
-
 
212
my %ukHopsReleases = (
-
 
213
    '6222'      => { name => 'MainLine', 'trunk' => 1 },
-
 
214
    '14503'     => { name => 'Hops3' },
-
 
215
    '21864'     => { name => 'Hops3.6' },
-
 
216
    '22303'     => { name => 'Hops3.7' },
-
 
217
    '17223'     => { name => 'Hops4' },
-
 
218
);
-
 
219
 
-
 
220
# The following packages will have the version in the specified release forced to be on the trunk
-
 
221
# A trunk will be forced and the version will be on it.
-
 
222
#   May only work if the version in the release is also a TIP
-
 
223
my %ukHopsTip = (
-
 
224
    'ItsoMessaging'         => '6222',
-
 
225
    'MessageProcessor'      => '6222',
-
 
226
    'StrongNameKey'         => '6222',
-
 
227
);
-
 
228
 
165
################################################################################
229
################################################################################
166
#   Global data
230
#   Global data
167
#
231
#
168
my $VERSION = "1.0.0";
232
my $VERSION = "1.0.0";
169
my $RM_DB;
233
my $RM_DB;
Line 203... Line 267...
203
my $allSvn;
267
my $allSvn;
204
my @multiplePaths;
268
my @multiplePaths;
205
my @badEssentials;
269
my @badEssentials;
206
my %svnData;
270
my %svnData;
207
my $cwd;
271
my $cwd;
-
 
272
my $mustConvertFileNames;
208
 
273
 
209
my $packageNames;
274
my $packageNames;
210
my @packageNames;
275
my @packageNames;
211
my $multiPackages = -1;
276
my $multiPackages = -1;
212
my $visitId = 0;
277
my $visitId = 0;
213
my $noTransfer;
278
my $noTransfer;
214
my $rippleCount = 0;
279
my $rippleCount = 0;
215
my $svnRepo;
280
my $svnRepo;
216
my $processCount = 0;
281
my $processCount = 0;
217
my $processTotal = 0;
282
my $processTotal = 0;
-
 
283
my $recentCount = 0;
-
 
284
my $packageReLabelCount = 0;
-
 
285
my %saneLabels;
218
 
286
 
219
our $GBE_RM_URL;
287
our $GBE_RM_URL;
220
my $UNIX = $ENV{'GBE_UNIX'};
288
my $UNIX = $ENV{'GBE_UNIX'};
221
 
289
 
222
my $result = GetOptions (
290
my $result = GetOptions (
223
                "help+"         => \$opt_help,          # flag, multiple use allowed
291
                "help+"         => \$opt_help,          # flag, multiple use allowed
224
                "manual:3"      => \$opt_help,
292
                "manual:3"      => \$opt_help,
225
                "verbose:+"     => \$opt_verbose,       # Versose
293
                "verbose:+"     => \$opt_verbose,       # Versose
226
                "repository:s"  => \$opt_repo,          # Name of repository
294
                "repository:s"  => \$opt_repo,          # Name of repository
-
 
295
                'rbase:s'       => \$opt_repo_base,     # Base of the repo
227
                "flat!"         => \$opt_flat,          # Flat structure
296
                "flat!"         => \$opt_flat,          # Flat structure
228
                "test!"         => \$opt_test,          # Test operations
297
                "test!"         => \$opt_test,          # Test operations
229
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
298
                "reuse!"        => \$opt_reuse,         # Reuse ClearCase views
230
                "age:i"         => \$opt_age,           # Only recent versions
299
                "age:i"         => \$opt_age,           # Only recent versions
231
                "dump:1"        => \$opt_dump,          # Dump Data
300
                "dump:1"        => \$opt_dump,          # Dump Data
Line 239... Line 308...
239
                "delete!"       => \$opt_delete,
308
                "delete!"       => \$opt_delete,
240
                "postimage!"    => \$opt_postimage,
309
                "postimage!"    => \$opt_postimage,
241
                'workdir:s'     => \$opt_workDir,
310
                'workdir:s'     => \$opt_workDir,
242
                'filelist:s'    => \$opt_fileList,      # A list of CC tags
311
                'filelist:s'    => \$opt_fileList,      # A list of CC tags
243
                'resume:s'      => \$opt_resume,
312
                'resume:s'      => \$opt_resume,
-
 
313
                'relabel!'      => \$opt_relabel,
244
                );
314
                );
245
 
315
 
246
#
316
#
247
#   Process help and manual options
317
#   Process help and manual options
248
#
318
#
Line 443... Line 513...
443
 
513
 
444
    chdir $cwd || Error ("Cannot cd back to $cwd");
514
    chdir $cwd || Error ("Cannot cd back to $cwd");
445
    rmdir $workDir;
515
    rmdir $workDir;
446
    Warning ("Work Directory still exists: $workDir");
516
    Warning ("Work Directory still exists: $workDir");
447
    saveData();
517
    saveData();
448
#DebugDumpData("AllData", \%versions );
-
 
449
    
-
 
450
}
518
}
451
 
519
 
452
#-------------------------------------------------------------------------------
520
#-------------------------------------------------------------------------------
453
# Function        : setPruneMode
521
# Function        : setPruneMode
454
#
522
#
Line 545... Line 613...
545
        $opt_flat = 1 unless defined $opt_flat;
613
        $opt_flat = 1 unless defined $opt_flat;
546
        setPruneMode('none') unless (defined $opt_pruneModeString);
614
        setPruneMode('none') unless (defined $opt_pruneModeString);
547
 
615
 
548
    } elsif ( exists $suffixes{'.tool'} ) {
616
    } elsif ( exists $suffixes{'.tool'} ) {
549
        $packageType = 'TOOL';
617
        $packageType = 'TOOL';
550
        $Projects{'.tool'}{'Trunk'} = 1;
618
        $Projects{'.tool'}{Trunk} = 1;
551
        $singleProject = 1;
619
        $singleProject = 1;
552
        setPruneMode('none') unless (defined $opt_pruneModeString);
620
        setPruneMode('none') unless (defined $opt_pruneModeString);
553
#        $opt_flat = 1;
621
#        $opt_flat = 1;
554
 
622
 
555
    } elsif ( scalar (keys %suffixes ) == 1 ) {
623
    } elsif ( scalar (keys %suffixes ) == 1 ) {
Line 561... Line 629...
561
    }
629
    }
562
 
630
 
563
    #
631
    #
564
    #   Some packages are special
632
    #   Some packages are special
565
    #
633
    #
-
 
634
    if ( $svnRepo =~ m~/Manufacturing(/|$)~ )
-
 
635
    {
-
 
636
        Message ("Set Manufacturing Repo style");
-
 
637
        $opt_flat = 1;
-
 
638
        setPruneMode('none') unless (defined $opt_pruneModeString);
-
 
639
    }
-
 
640
 
566
 
641
 
567
    if ( $packageNames[0] =~ m'^br_applet_' )
642
    if ( $packageNames[0] =~ m'^br_applet_' )
568
    {
643
    {
569
        $opt_flat = 1 unless defined $opt_flat;
644
      $opt_flat = 1 unless defined $opt_flat;
-
 
645
    }
-
 
646
 
-
 
647
    foreach  ( @excludeFromImport )
-
 
648
    {
-
 
649
         $specialPackages{$_} .= 'protected,';
570
    }
650
    }
571
 
651
 
572
    if ( exists $specialPackages{$packageNames[0]} )
652
    if ( exists $specialPackages{$packageNames[0]} )
573
    {
653
    {
574
        my $data = $specialPackages{$packageNames[0]};
654
        my $data = $specialPackages{$packageNames[0]};
Line 593... Line 673...
593
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
673
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
594
            $opt_ignoreProjectBaseErrors = 1;
674
            $opt_ignoreProjectBaseErrors = 1;
595
            Message ("Ignore ProjectBase Errors");
675
            Message ("Ignore ProjectBase Errors");
596
        }
676
        }
597
 
677
 
-
 
678
        if ( index( $data, 'utf8,' ) >= 0) {
-
 
679
            $mustConvertFileNames = 1;
-
 
680
            Message ("Convert filenames to UTF8");
-
 
681
        }
598
    }
682
    }
599
 
683
 
600
    Message("Package Type: $packageType, $pruneModeString");
684
    Message("Package Type: $packageType, $pruneModeString");
601
}
685
}
602
 
686
 
Line 839... Line 923...
839
                    $versions{$entry}{newSuffix} = 1;
923
                    $versions{$entry}{newSuffix} = 1;
840
                }
924
                }
841
            }
925
            }
842
        }
926
        }
843
    }
927
    }
-
 
928
 
-
 
929
    #
-
 
930
    #   Mark UkHops special points
-
 
931
    #
-
 
932
    foreach my $entry ( keys(%versions) ) {
-
 
933
        foreach my $rtag_id ( keys %{$versions{$entry}{Releases}}  ) {
-
 
934
            next unless ( exists $ukHopsReleases{$rtag_id} );
-
 
935
            next unless ( $svnRepo =~ m~/ITSO_TRACS$~ );
-
 
936
 
-
 
937
            #
-
 
938
            #   This package is current in a special ukHops release
-
 
939
            #   Need to handle the differently
-
 
940
            #
-
 
941
            my $ukData =  $ukHopsReleases{$rtag_id};
-
 
942
 
-
 
943
            # Mark version we want on the trunk
-
 
944
            # Will calculate tip later
-
 
945
            if ( $ukData->{trunk} )
-
 
946
            {
-
 
947
                #
-
 
948
                #   Can only place on trunk IFF its a tip
-
 
949
                #   May have a WIP.
-
 
950
                #   Solution. Walk to the tip, but only if there is one
-
 
951
                #             path.
-
 
952
                #
-
 
953
                my $end = $entry;
-
 
954
                my $last;
-
 
955
                while ( $end )
-
 
956
                {
-
 
957
                    $last = $end;
-
 
958
                    if ( @{$versions{$end}{next}} > 1)
-
 
959
                    {
-
 
960
                        Warning ("Uk Release. Preferred trunk is not a tip: $versions{$entry}{vname}");
-
 
961
                        last;
-
 
962
                    }
-
 
963
 
-
 
964
                    $end = @{$versions{$end}{next}}[0];
-
 
965
                }
-
 
966
                $versions{$last}{ukTrunk} = 1 ;
-
 
967
            }
-
 
968
 
-
 
969
            #
-
 
970
            #   What to do if the version is in more than one release
-
 
971
            #
-
 
972
            $versions{$entry}{ukBranch}++;
-
 
973
            if ( $versions{$entry}{ukBranch} > 1 )
-
 
974
            {
-
 
975
                Warning ("Version found in multiple Uk Releases - don't know what to do");
-
 
976
            }
-
 
977
 
-
 
978
            #
-
 
979
            #   What to do if the package has multiple version in a release
-
 
980
            #
-
 
981
            $ukData->{count}++;
-
 
982
            if ( $ukData->{count} > 1 )
-
 
983
            {
-
 
984
                Warning ("Package has multiple versions in the one Uk Release: $versions{$entry}{Releases}{$rtag_id}{rname}");
-
 
985
            }
-
 
986
        }
-
 
987
    }
844
    
988
    
845
    #
989
    #
846
    #   Prune
990
    #   Prune
847
    #   Marks paths to root for all essential packages
991
    #   Marks paths to root for all essential packages
848
    #   Marks the last-N from all essential packages
992
    #   Marks the last-N from all essential packages
Line 858... Line 1002...
858
            my $entry = $_;
1002
            my $entry = $_;
859
            my $count = 0;
1003
            my $count = 0;
860
            while ( $entry )
1004
            while ( $entry )
861
            {
1005
            {
862
                last if ( $versions{$entry}{KeepMe} );
1006
                last if ( $versions{$entry}{KeepMe} );
863
                unless ( $versions{$entry}{isaRipple} )
1007
#                unless ( $versions{$entry}{isaRipple} )
864
                {
1008
                {
865
                    my $keepFlag = ($count++ < $opt_retaincount);
1009
                    my $keepFlag = ($count++ < $opt_retaincount);
866
                    last unless ( $keepFlag );
1010
                    last unless ( $keepFlag );
867
                    $versions{$entry}{KeepMe} = $keepFlag;
1011
                    $versions{$entry}{KeepMe} = $keepFlag;
868
                }
1012
                }
869
                $entry = $versions{$entry}{last}
1013
                $entry = $versions{$entry}{last}
870
            }
1014
            }
871
        }
1015
        }
872
 
1016
 
873
        #
1017
        #
-
 
1018
        #   Keep recent versions
-
 
1019
        #       Keep versions created in the last N days
-
 
1020
        #       Will keep recent ripples too
-
 
1021
        #
-
 
1022
        if ( $pruneMode == 1 )
-
 
1023
        {
-
 
1024
            foreach my $entry ( keys(%versions) )
-
 
1025
            {
-
 
1026
                next unless ( $versions{$entry}{Age} <= $opt_recentAge  );
-
 
1027
                $versions{$entry}{keepRecent} = 1;
-
 
1028
                $recentCount++;
-
 
1029
#print "--- Recent version $versions{$entry}{vname}, $versions{$entry}{Age} <= $opt_recentAge\n";
-
 
1030
            }
-
 
1031
 
-
 
1032
#            #
-
 
1033
#            #   Keep the tip of each branch
-
 
1034
#            #
-
 
1035
#            foreach my $entry ( @endPoints )
-
 
1036
#            {
-
 
1037
#                next if exists $versions{$entry}{keepRecent};
-
 
1038
#                $versions{$entry}{keepRecent} = 1;
-
 
1039
##print "--- Tip version $versions{$entry}{vname}\n";
-
 
1040
#            }
-
 
1041
        }
-
 
1042
        
-
 
1043
        #
874
        #   Keep versions that are common parents to Essential Versions
1044
        #   Keep versions that are common parents to Essential Versions
875
        #       Mark paths through the tree to essential versions
1045
        #       Mark paths through the tree to essential versions
876
        #       Mark nodes with the number of essential versions that they sprout
1046
        #       Mark nodes with the number of essential versions that they sprout
877
        #   Don't do it if we are ripple pruning
1047
        #   Don't do it if we are ripple pruning
878
        #
1048
        #
Line 928... Line 1098...
928
        {
1098
        {
929
            my ($entry) = @_;
1099
            my ($entry) = @_;
930
 
1100
 
931
            return 0 unless ( exists $versions{$entry} );
1101
            return 0 unless ( exists $versions{$entry} );
932
            return 0 unless ( $versions{$entry}{last} );
1102
            return 0 unless ( $versions{$entry}{last} );
933
            return 0 if ( ($pruneMode == 2) && exists $versions{$entry}{KeepMe} );
1103
#            return 0 if ( ($pruneMode == 2) && exists $versions{$entry}{KeepMe} );
-
 
1104
            return 0 if ( exists $versions{$entry}{KeepMe} );
934
            return 0 if ( exists $versions{$entry}{Essential} );
1105
            return 0 if ( exists $versions{$entry}{Essential} );
935
            return 0 if ( $versions{$entry}{newSuffix} );
1106
            return 0 if ( $versions{$entry}{newSuffix} );
936
            return 0 if ( $versions{$entry}{newSuffix} && (exists $versions{$entry}{EssentialPath}) );
1107
            return 0 if ( $versions{$entry}{newSuffix} && (exists $versions{$entry}{EssentialPath}) );
937
#            return 1 if ( exists $versions{$entry}{DeadWood} );
1108
#            return 1 if ( exists $versions{$entry}{DeadWood} );
938
            return 0 if ( exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
1109
            return 0 if ( exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
939
            return 0 if ( exists $versions{$entry}{keepLowestRipple} &&  $versions{$entry}{keepLowestRipple} );
1110
            return 0 if ( exists $versions{$entry}{keepLowestRipple} &&  $versions{$entry}{keepLowestRipple} );
940
            return 0 if ( ($pruneMode == 1) && ! $versions{$entry}{isaRipple} );
1111
            return 0 if ( ($pruneMode == 1) && ! $versions{$entry}{isaRipple} );
-
 
1112
            return 0 if ( exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
941
            return 1;
1113
            return 1;
942
        }
1114
        }
943
 
1115
 
944
        foreach my $entry ( keys(%versions) )
1116
        foreach my $entry ( keys(%versions) )
945
        {
1117
        {
Line 977... Line 1149...
977
        #
1149
        #
978
        calcRippleGroups();
1150
        calcRippleGroups();
979
    }
1151
    }
980
 
1152
 
981
    #
1153
    #
-
 
1154
    #   Want some versions to be forced to tip trunk
-
 
1155
    #
-
 
1156
    foreach my $name ( keys %ukHopsTip )
-
 
1157
    {
-
 
1158
        foreach my $entry ( keys(%versions) )
-
 
1159
        {
-
 
1160
            next unless ( $versions{$entry}{name} eq $name  );
-
 
1161
            next unless ( exists $versions{$entry}{Releases}{$ukHopsTip{$name}} );
-
 
1162
 
-
 
1163
            #
-
 
1164
            #   Force this suffix to be the trunk
-
 
1165
            #   Remove all others
-
 
1166
            #
-
 
1167
            foreach my $suffix ( keys %Projects )
-
 
1168
            {
-
 
1169
                delete $Projects{$suffix}{Trunk};
-
 
1170
            }
-
 
1171
            my $suffix = $versions{$entry}{suffix};
-
 
1172
            $Projects{$suffix}{Trunk} = 1;
-
 
1173
        }
-
 
1174
    }
-
 
1175
 
-
 
1176
    #
982
    #   Calculate best through-path for branches in the tree
1177
    #   Calculate best through-path for branches in the tree
983
    #   Attempt to keep that 'max' version on the mainline
1178
    #   Attempt to keep that 'max' version on the mainline
984
    #   May be modified by -tip=nnnn
1179
    #   May be modified by -tip=nnnn
985
    #
1180
    #
986
    #   For each leaf (end point), walk backwards and mark each node with the
1181
    #   For each leaf (end point), walk backwards and mark each node with the
Line 992... Line 1187...
992
    #   be recalculated
1187
    #   be recalculated
993
    #
1188
    #
994
 
1189
 
995
    Message ("Calculate Max Version");
1190
    Message ("Calculate Max Version");
996
    my $maxVersion;
1191
    my $maxVersion;
997
 
-
 
998
    foreach my $entry ( @endPoints )
1192
    foreach my $entry ( @endPoints )
999
    {
1193
    {
1000
        my $lastSuffix;
1194
        my $lastSuffix;
1001
        my $forceTip;
1195
        my $forceTip;
1002
        while ( $entry )
1196
        while ( $entry )
Line 1004... Line 1198...
1004
            if (!defined($lastSuffix) || ($versions{$entry}{suffix} ne $lastSuffix) )
1198
            if (!defined($lastSuffix) || ($versions{$entry}{suffix} ne $lastSuffix) )
1005
            {
1199
            {
1006
                $maxVersion = '0';
1200
                $maxVersion = '0';
1007
                $visitId++;
1201
                $visitId++;
1008
                $forceTip = ( exists $tipVersions{$versions{$entry}{vname}} );
1202
                $forceTip = ( exists $tipVersions{$versions{$entry}{vname}} );
-
 
1203
                $forceTip = 1 if $versions{$entry}{ukTrunk};
1009
                delete $tipVersions{$versions{$entry}{vname}};
1204
                delete $tipVersions{$versions{$entry}{vname}};
1010
                $maxVersion = '999.999.999.999.zzz' if ( $forceTip );
1205
                $maxVersion = '999.999.999.999.zzz' if ( $forceTip );
1011
                $lastSuffix = $versions{$entry}{suffix};
1206
                $lastSuffix = $versions{$entry}{suffix};
1012
#print "---Tip Found\n" if $forceTip;
1207
#print "---Tip Found\n" if $forceTip;
1013
            }
1208
            }
Line 1135... Line 1330...
1135
    Message("Retained entries: $processTotal" );
1330
    Message("Retained entries: $processTotal" );
1136
    Message("Pruned entries: $pruneCount");
1331
    Message("Pruned entries: $pruneCount");
1137
    Message("Deadwood entries: $trimCount");
1332
    Message("Deadwood entries: $trimCount");
1138
    Message("Bad Singletons: $badSingletonCount");
1333
    Message("Bad Singletons: $badSingletonCount");
1139
    Message("Ripples: $rippleCount");
1334
    Message("Ripples: $rippleCount");
-
 
1335
    Message("Recent entries: $recentCount");
1140
}
1336
}
1141
 
1337
 
1142
sub calculateWalkOrder
1338
sub calculateWalkOrder
1143
{
1339
{
1144
    my ($entry) = @_;
1340
    my ($entry) = @_;
Line 1227... Line 1423...
1227
 
1423
 
1228
#-------------------------------------------------------------------------------
1424
#-------------------------------------------------------------------------------
1229
# Function        : calcRippleGroups
1425
# Function        : calcRippleGroups
1230
#
1426
#
1231
# Description     : Locate and mark ripple groups
1427
# Description     : Locate and mark ripple groups
1232
#                   packages that are ripples fo each other
1428
#                   packages that are ripples of each other
1233
#                       Keep first version of each ripple. Must keep first
1429
#                       Keep first version of each ripple. Must keep first
1234
#                       Group ripples together so that they can be
1430
#                       Group ripples together so that they can be
1235
#                       proccessed at the same time
1431
#                       proccessed at the same time
1236
#
1432
#
1237
# Inputs          : 
1433
# Inputs          : 
Line 1316... Line 1512...
1316
            $createBranch = 1;
1512
            $createBranch = 1;
1317
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1513
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1318
        }
1514
        }
1319
 
1515
 
1320
        newPackageVersion( $entry );
1516
        newPackageVersion( $entry );
-
 
1517
        unless ( $globalError )
-
 
1518
        {
-
 
1519
            getSvnData();
-
 
1520
            createImages();
-
 
1521
        }
-
 
1522
 
1321
no warnings "recursion";
1523
no warnings "recursion";
1322
        processBranch (@{$versions{$entry}{next}});
1524
        processBranch (@{$versions{$entry}{next}});
1323
    }
1525
    }
1324
}
1526
}
1325
 
1527
 
Line 1353... Line 1555...
1353
    Message ("------------------------------------------------------------------" );
1555
    Message ("------------------------------------------------------------------" );
1354
    Message ("Package $processCount of $processTotal");
1556
    Message ("Package $processCount of $processTotal");
1355
 
1557
 
1356
    Message ("New package-version: " . GetVname($entry) . " Tag: " . $versions{$entry}{vcsTag} );
1558
    Message ("New package-version: " . GetVname($entry) . " Tag: " . $versions{$entry}{vcsTag} );
1357
 
1559
 
-
 
1560
    #
-
 
1561
    #   Detect user abort
-
 
1562
    #
-
 
1563
    if ( -f $cwd . '/stopfile' )
-
 
1564
    {
-
 
1565
        $globalError = 1;
-
 
1566
        Message ("Stop file located");
-
 
1567
    }
1358
    if ( $opt_resume )
1568
    if ( $opt_resume )
1359
    {
1569
    {
1360
        return
1570
        return
1361
        unless ( $opt_resume eq $versions{$entry}{vcsTag} );
1571
        unless ( $opt_resume eq $versions{$entry}{vcsTag} );
1362
        $opt_resume = '';
1572
        $opt_resume = '';
1363
    }
1573
    }
1364
 
1574
 
1365
 
-
 
1366
    #
1575
    #
1367
    #   If we have a global error,then we pretend to process, but we
1576
    #   If we have a global error,then we pretend to process, but we
1368
    #   report errors for the logging system
1577
    #   report errors for the logging system
1369
    #
1578
    #
1370
    unless ( $globalError )
1579
    if ( $globalError )
-
 
1580
    {
-
 
1581
        Message ("Global error prevents futher importation");
-
 
1582
    }
-
 
1583
    else
1371
    {
1584
    {
1372
        #
1585
        #
1373
        #   Call worker function
1586
        #   Call worker function
1374
        #   It will exist on any error so that it can be logged
1587
        #   It will exist on any error so that it can be logged
1375
        #
1588
        #
Line 1418... Line 1631...
1418
    $data{errFlags} = $flags;
1631
    $data{errFlags} = $flags;
1419
    $data{duration} = $duration;
1632
    $data{duration} = $duration;
1420
    $versions{$entry}{rmRef} = $data{rmRef};
1633
    $versions{$entry}{rmRef} = $data{rmRef};
1421
    delete $data{rmRef};
1634
    delete $data{rmRef};
1422
    delete $data{tag};
1635
    delete $data{tag};
1423
    delete $data{ViewRoot};
1636
    ##delete $data{ViewRoot};
1424
    $versions{$entry}{data} = \%data;
1637
    $versions{$entry}{data} = \%data;
1425
 
1638
 
1426
    #
1639
    #
1427
    #   Delete the created view
1640
    #   Delete the created view
1428
    #   Its just a directory, so delete it
1641
    #   Its just a directory, so delete it
1429
    #
1642
    #
1430
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1643
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1431
    {
1644
    {
-
 
1645
        if ( !$opt_reuse || ($rv && ($rv != 4 && $rv != 12 )) )
-
 
1646
        {
-
 
1647
            Message ("Delete View: $data{ViewRoot}");
1432
        RmDirTree ($data{ViewRoot} ) if ( !$opt_reuse || $rv );
1648
            RmDirTree ($data{ViewRoot} );
-
 
1649
        }
-
 
1650
        else
-
 
1651
        {
-
 
1652
            Message ("Retaining View: $data{ViewRoot}");
-
 
1653
        }
-
 
1654
 
-
 
1655
    }
-
 
1656
    else
-
 
1657
    {
-
 
1658
        Message ("No view to delete: $data{ViewRoot}");
1433
    }
1659
    }
1434
 
1660
 
1435
 
1661
 
1436
    #
1662
    #
1437
    #   If this version has any 'ripples' then process them while we have the
1663
    #   If this version has any 'ripples' then process them while we have the
1438
    #   main view. Note the ripple list may contain entries that do not
1664
    #   main view. Note the ripple list may contain entries that do not
1439
    #   exist - they will have been pruned.
1665
    #   exist - they will have been pruned.
1440
    #
1666
    #
-
 
1667
if(1) {
1441
    foreach my $rentry ( @{$versions{$entry}{rippleList}} )
1668
    foreach my $rentry ( @{$versions{$entry}{rippleList}} )
1442
    {
1669
    {
1443
        next unless( exists $versions{$rentry} );
1670
        next unless( exists $versions{$rentry} );
1444
 
1671
 
1445
        if ($versions{$rentry}{Processed})
1672
        if ($versions{$rentry}{Processed})
Line 1450... Line 1677...
1450
 
1677
 
1451
        Message ("Proccessing associated Ripple: " . GetVname($rentry));
1678
        Message ("Proccessing associated Ripple: " . GetVname($rentry));
1452
        newPackageVersion($rentry);
1679
        newPackageVersion($rentry);
1453
    }
1680
    }
1454
}
1681
}
-
 
1682
}
1455
 
1683
 
1456
#-------------------------------------------------------------------------------
1684
#-------------------------------------------------------------------------------
1457
# Function        : newPackageVersionBody
1685
# Function        : newPackageVersionBody
1458
#
1686
#
1459
# Description     : Perform the bulk of the work in creating a new PackageVersion
1687
# Description     : Perform the bulk of the work in creating a new PackageVersion
Line 1472... Line 1700...
1472
{
1700
{
1473
    my ($data, $entry) = @_;
1701
    my ($data, $entry) = @_;
1474
    my $rv;
1702
    my $rv;
1475
    my $cc_label;
1703
    my $cc_label;
1476
    my $cc_path;
1704
    my $cc_path;
-
 
1705
    my $cc_path_original;
1477
 
1706
 
1478
    #
1707
    #
1479
    #   Init Data
1708
    #   Init Data
1480
    #
1709
    #
1481
    $data->{rmRef} = 'ERROR';
1710
    $data->{rmRef} = 'ERROR';
Line 1514... Line 1743...
1514
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
1743
    $data->{tag} =~ m~^(.+?)::(.*?)(::(.+))?$~;
1515
    $cc_label = $4;
1744
    $cc_label = $4;
1516
    $cc_path = $2;
1745
    $cc_path = $2;
1517
    $cc_path = '/' . $cc_path;
1746
    $cc_path = '/' . $cc_path;
1518
    $cc_path =~ tr~\\/~/~s;
1747
    $cc_path =~ tr~\\/~/~s;
-
 
1748
    $cc_path_original = $cc_path;
1519
 
1749
 
1520
    #
1750
    #
1521
    #   Correct well known path mistakes
1751
    #   Correct well known path mistakes
1522
    #
1752
    #
-
 
1753
    $cc_path =~ s~/build.pl$~~i;
-
 
1754
    $cc_path =~ s~/src$~~i;
-
 
1755
    $cc_path =~ s~/cpp$~~i;
-
 
1756
    $cc_path =~ s~/MASS_Dev/Infra/~/MASS_Dev_Infra/~i;
-
 
1757
    $cc_path =~ s~/MASS_Dev/Tools/~/MASS_Dev_Tools/~i;
1523
    $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
1758
    $cc_path =~ s~/MASS_Dev/Bus/~/MASS_Dev_Bus/~i;
1524
    $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
1759
    $cc_path =~ s~/MASS_Dev_Bus/Cbp/~/MASS_Dev_Bus/CBP/~i;
1525
    $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
1760
    $cc_path =~ s~/MREF_Package/ergpostmongui$~/MREF_Package/ergpostmongui~i;
1526
    $cc_path =~ s~/MREF_21/MREF_Package/~/MREF_Package/~i;
1761
    $cc_path =~ s~/MREF_../MREF_Package/~/MREF_Package/~i;
-
 
1762
    $cc_path =~ s~/MREF_Package/mass_ergocdp/~/MREF_Package/ergocdp/~i;
-
 
1763
    $cc_path =~ s~/MASS_Dev_Bus/CBP/systemCD.ejb~/MASS_Dev_Bus/CBP/systemCD/ejb~i;
-
 
1764
    $cc_path =~ s~/MASS_Dev_Bus/Financial/cpp/paymentmanager~/MASS_Dev_Bus/Financial/cpp/paymentmanager~i;
-
 
1765
    $cc_path =~ s~/MASS_Dev_Bus/WebServices~/MASS_Dev_Bus/WebServices~i;
-
 
1766
    $cc_path =~ s~/MASS_Dev_Bus/CBP/nullAdapter~//MASS_Dev_Bus/CBP/nullAdaptor~i;
-
 
1767
 
-
 
1768
    $cc_path = '/MASS_Dev_Bus' if ( $cc_path =~ m~/MASS_Dev_Bus/ImageCapture(/|$)~i );
-
 
1769
    $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'EJBEnqPxyConnector');
-
 
1770
    $cc_path = '/MASS_Dev_Bus/CBP/enquiry' if ( $versions{$entry}{name} eq 'proxyif4j');
-
 
1771
    $cc_path = '/MASS_Dev_Bus' if ( $versions{$entry}{name} eq 'ImageCaptureTomcatDeployment');
-
 
1772
    $cc_path = '/MASS_Dev_Bus/WebServices/MassWS' if ( $versions{$entry}{name} eq 'MassWebServicesImpl');
-
 
1773
 
-
 
1774
    if (   $versions{$entry}{name} =~ m/^ERGagency$/i
-
 
1775
        || $versions{$entry}{name} =~ m/^ERGavm$/i
-
 
1776
        || $versions{$entry}{name} =~ m/^ERGboi$/i
-
 
1777
        || $versions{$entry}{name} =~ m/^ERGcallcenter$/i
-
 
1778
        || $versions{$entry}{name} =~ m/^ERGcardholder$/i
-
 
1779
        || $versions{$entry}{name} =~ m/^ERGcdaimports$/i
-
 
1780
        || $versions{$entry}{name} =~ m/^ERGcda$/i
-
 
1781
        || $versions{$entry}{name} =~ m/^ERGcscedit$/i
-
 
1782
        || $versions{$entry}{name} =~ m/^ERGcs$/i
-
 
1783
        || $versions{$entry}{name} =~ m/^ERGofs$/i
-
 
1784
        || $versions{$entry}{name} =~ m/^ERGols$/i
-
 
1785
        || $versions{$entry}{name} =~ m/^ERGtpf$/i
-
 
1786
        || $versions{$entry}{name} =~ m/^ERGorasys$/i
-
 
1787
        || $versions{$entry}{name} =~ m/^ERGoracs$/i
-
 
1788
        || $versions{$entry}{name} =~ m/^ERGpxyif$/i
-
 
1789
        || $versions{$entry}{name} =~ m/^ERGtp5upg$/i
-
 
1790
        || $versions{$entry}{name} =~ m/^ERGinstitutional$/i
-
 
1791
        || $versions{$entry}{name} =~ m/^ERGinfra$/i
-
 
1792
        || $versions{$entry}{name} =~ m/^ERGcrrpts$/i
-
 
1793
        || $versions{$entry}{name} =~ m/^ERGmiddle$/i
-
 
1794
        || $versions{$entry}{name} =~ m/^ERGmiddleapi$/i
-
 
1795
        || $versions{$entry}{name} =~ m/^ERGwebapi$/i
-
 
1796
        || $versions{$entry}{name} =~ m/^ERGwebtestui$/i
-
 
1797
        || $versions{$entry}{name} =~ m/^ERGwebesbui$/i
-
 
1798
        || $versions{$entry}{name} =~ m/^ERGwspiv$/i
-
 
1799
        || $versions{$entry}{name} =~ m/^ERGwscst$/i
-
 
1800
        || $versions{$entry}{name} =~ m/^sposMUG$/i
-
 
1801
        || $versions{$entry}{name} =~ m/^ERGfinman$/i
-
 
1802
        || $versions{$entry}{name} =~ m/^ERGkm$/i
-
 
1803
        || $versions{$entry}{name} =~ m/^ERGxml$/i
-
 
1804
        || $versions{$entry}{name} =~ m/^ERGoradacw$/i
-
 
1805
        || $versions{$entry}{name} =~ m/^ERGtru$/i
-
 
1806
        )
-
 
1807
    {
-
 
1808
        $cc_path = '/MREF_Package';
-
 
1809
    }
-
 
1810
 
-
 
1811
    if (   $versions{$entry}{name} =~ m/^tp5000_MUG$/i )
-
 
1812
    {
-
 
1813
        if ( $versions{$entry}{version} =~ m~vtk$~ )
-
 
1814
        {
-
 
1815
            $cc_path = '/MREF_Package';
-
 
1816
        }
-
 
1817
    }
1527
 
1818
 
-
 
1819
    if ( $cc_path_original ne $cc_path )
-
 
1820
    {
-
 
1821
            Message ("Package: $versions{$entry}{name}. Forcing CC path to: $cc_path" );
-
 
1822
    }
-
 
1823
    
1528
#print "--- Path: $cc_path, Label: $cc_label\n";
1824
#print "--- Path: $cc_path, Label: $cc_label\n";
1529
 
1825
 
1530
    #
1826
    #
1531
    #   Create CC view
1827
    #   Create CC view
1532
    #   Import into Subversion View
1828
    #   Import into Subversion View
1533
    #
1829
    #
1534
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
1830
    $rv = extractFilesFromClearCase( $data, $cc_path, $cc_label );
1535
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
-
 
1536
 
-
 
1537
    if ( $opt_preserveProjectBase )
-
 
1538
    {
-
 
1539
        my $cc_vob = $cc_path;
-
 
1540
        $cc_vob =~ s~^/~~;
-
 
1541
        $cc_vob =~ s~/.*~~;
-
 
1542
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
-
 
1543
        Message ("Preserving Project Base");
-
 
1544
    }
-
 
1545
    $data->{ViewPath} =~  tr~/~/~s;
-
 
1546
 
-
 
1547
    if ( $opt_reuse && -d $data->{ViewPath}  )
-
 
1548
    {
-
 
1549
        Message ("Reusing view: $cc_label");
-
 
1550
    }
-
 
1551
    else
-
 
1552
    {
-
 
1553
        my @args;
-
 
1554
        push (@args, '-view', $opt_name ) if ( defined $opt_name );
-
 
1555
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
-
 
1556
                    "-label=$cc_label" ,
-
 
1557
                    "-path=$cc_path",
-
 
1558
                    @args
-
 
1559
                    );
1831
    return $rv if ( $rv );
1560
 
-
 
1561
        unless ( -d $data->{ViewPath}  )
-
 
1562
        {
-
 
1563
            $data->{errStr} = 'Failed to extract files from CC';
-
 
1564
            return 2;
-
 
1565
        }
-
 
1566
    }
-
 
1567
 
-
 
1568
 
1832
 
1569
    #
1833
    #
1570
    #   Some really ugly packages make use of a Jats feature called 'SetProjectBase'
1834
    #   Some really ugly packages make use of a Jats feature called 'SetProjectBase'
1571
    #   Detect such packages as we will need to handle them differently
1835
    #   Detect such packages as we will need to handle them differently
1572
    #   Can't really handle it on the fly
1836
    #   Can't really handle it on the fly
1573
    #   All we can do is detct it and report it - at the moment
1837
    #   All we can do is detect it and report it - at the moment
1574
    #
1838
    #
1575
    if (detectProjectBaseUsage($data, $cc_path) )
1839
    if (detectProjectBaseUsage($data, $cc_path) )
1576
    {
1840
    {
1577
        unless ( $opt_ignoreProjectBaseErrors )
1841
        unless ( $opt_ignoreProjectBaseErrors )
1578
        {
1842
        {
1579
            $data->{BadProjectBase}++;
1843
            $data->{BadProjectBase}++;
1580
            $data->{errStr} = 'Bad usage of ProjectBase detected';
1844
            $data->{errStr} = 'Bad usage of ProjectBase detected';
-
 
1845
            return 4;           # Lets see what the others look like too
1581
            return 14;
1846
#            return 14;
1582
        }
1847
        }
1583
    }
1848
    }
1584
 
1849
 
1585
 
1850
 
1586
    #
1851
    #
Line 1596... Line 1861...
1596
        #
1861
        #
1597
        #   Look in ViewPath
1862
        #   Look in ViewPath
1598
        #   If it contains only ONE directory then we can suck it up
1863
        #   If it contains only ONE directory then we can suck it up
1599
        #
1864
        #
1600
        my $testDir = findDirWithStuff( $data->{ViewPath} );
1865
        my $testDir = findDirWithStuff( $data->{ViewPath} );
-
 
1866
 
1601
        unless ( $data->{ViewPath} eq $testDir  )
1867
        unless ( $data->{ViewPath} eq $testDir  )
1602
        {
1868
        {
1603
            Message ("Adjust Base Dir: $testDir");
1869
            Message ("Adjust Base Dir: $testDir");
1604
            $data->{adjustedPath} = $data->{ViewPath};
1870
            $data->{adjustedPath} = $data->{ViewPath};
1605
            $data->{ViewPath} = $testDir;
1871
            $data->{ViewPath} = $testDir;
1606
        }
1872
        }
1607
    }
1873
    }
-
 
1874
 
-
 
1875
    #
-
 
1876
    #   Some packages have filenames that are need to be converted
-
 
1877
    #
-
 
1878
    if ( $mustConvertFileNames || 1  )
-
 
1879
    {
-
 
1880
        $rv = system ( '/home/dpurdie/svn/tools/convmv-1.15/convmv',
-
 
1881
                 '-fiso-8859-1',
-
 
1882
                 '-tutf8',
-
 
1883
                 '-r',
-
 
1884
                 '--notest',
-
 
1885
                 $data->{ViewPath} );
-
 
1886
 
-
 
1887
        if ( $rv )
-
 
1888
        {
-
 
1889
            $data->{errStr} = 'Failed to convert filenames to UTF8';
-
 
1890
            return 14;
-
 
1891
        }
-
 
1892
    }
1608
    
1893
    
1609
 
1894
 
1610
    #
1895
    #
1611
    #   Have a CC view
1896
    #   Have a CC view
1612
    #   Now we can create the SVN package and branching point before we
1897
    #   Now we can create the SVN package and branching point before we
Line 1684... Line 1969...
1684
    {
1969
    {
1685
        $data->{errStr} = 'Failed to import to SVN';
1970
        $data->{errStr} = 'Failed to import to SVN';
1686
        return 12;
1971
        return 12;
1687
    }
1972
    }
1688
 
1973
 
-
 
1974
    $versions{$entry}{TagCreated} = 1;
-
 
1975
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
-
 
1976
 
1689
    #
1977
    #
1690
    #   Read in the Rm Reference
1978
    #   Read in the Rm Reference
1691
    #   Retain entries in a global file
1979
    #   Retain entries in a global file
1692
    #
1980
    #
1693
    if ( -f $datafile  )
1981
    if ( -f $datafile  )
Line 1700... Line 1988...
1700
    {
1988
    {
1701
        $data->{errStr} = 'Failed to determine Rm Reference';
1989
        $data->{errStr} = 'Failed to determine Rm Reference';
1702
        return 13;
1990
        return 13;
1703
    }
1991
    }
1704
 
1992
 
-
 
1993
######################## Deleted ###############################################
-
 
1994
#
-
 
1995
#
-
 
1996
#    #
-
 
1997
#    #   Add supplemental tags if this version is in a 'Release'
-
 
1998
#    #   But only for some packages - else looks like a mess
-
 
1999
#    #   Just a solution for the ITSO guys
-
 
2000
#    #
-
 
2001
#    foreach my $rtag_id ( keys %{$versions{$entry}{Releases}}  )
-
 
2002
#    {
-
 
2003
#        next unless ( $svnRepo =~ m~/ITSO_TRACS(/|$)~);
-
 
2004
#
-
 
2005
#        my $prog_id = $versions{$entry}{Releases}{$rtag_id}{proj_id};
-
 
2006
#        Message ("Adding Release Tag:$prog_id:$rtag_id");
-
 
2007
#
-
 
2008
#        my $rtext = 'Release_' . saneString($versions{$entry}{Releases}{$rtag_id}{rname});
-
 
2009
#        my @comment;
-
 
2010
#        push @comment, "Tagged by ClearCase to Subversion import";
-
 
2011
#        push @comment, "Project:$prog_id:$versions{$entry}{Releases}{$rtag_id}{pname}";
-
 
2012
#        push @comment, "Release:$rtag_id:$versions{$entry}{Releases}{$rtag_id}{rname}";
-
 
2013
#
-
 
2014
#        $data->{ReleaseTag}{$prog_id}{$rtag_id}{name} = $rtext;
-
 
2015
#
-
 
2016
#        $rv = JatsToolPrint ( 'jats_svnlabel' ,
-
 
2017
#                    '-comment', encode('UTF-8', join("\n", @comment), Encode::FB_DEFAULT),
-
 
2018
#                    $data->{rmRef},
-
 
2019
#                    '-clone',
-
 
2020
#                    $rtext,
-
 
2021
##                    @args,
-
 
2022
#                    '-author=buildadm',
-
 
2023
#                     );
-
 
2024
#        $data->{ReleaseTag}{$prog_id}{$rtag_id}{eState} = $rv;
-
 
2025
#        $data->{ReleaseTag}{tCount}++;
-
 
2026
#
-
 
2027
#        if ( $rv )
-
 
2028
#        {
-
 
2029
#            $data->{ReleaseTag}{eCount}++;
-
 
2030
#            Warning("Failed to add Release Tag: $rtext");
-
 
2031
#        }
-
 
2032
#    }
-
 
2033
#
-
 
2034
######################## Deleted ###############################################
-
 
2035
 
1705
    Message ("RM Ref: $data->{rmRef}");
2036
    Message ("RM Ref: $data->{rmRef}");
1706
    unlink $datafile;
2037
    unlink $datafile;
1707
 
2038
 
1708
    # Detect empty packages
-
 
1709
    unless ( $data->{rmRef} =~ m~\@~ )
-
 
1710
    {
-
 
1711
        $data->{errStr} = 'Looks like empty source - version saved';
-
 
1712
        return 3;
-
 
1713
    }
-
 
1714
        
-
 
1715
    #
2039
    #
1716
    #   All is good
2040
    #   All is good
1717
    #
2041
    #
1718
    $versions{$entry}{TagCreated} = 1;
-
 
1719
    $firstVersionCreated = $entry unless ( $firstVersionCreated );
-
 
1720
 
-
 
1721
    $data->{errStr} = '';
2042
    $data->{errStr} = '';
1722
    return 0;
2043
    return 0;
1723
}
2044
}
1724
 
2045
 
1725
 
2046
 
Line 1964... Line 2285...
1964
    #
2285
    #
1965
    #   Perform the branch
2286
    #   Perform the branch
1966
    #
2287
    #
1967
    if ( defined $src_label )
2288
    if ( defined $src_label )
1968
    {
2289
    {
-
 
2290
        #
-
 
2291
        #   The 'clone' operation will backtrack the branch point
-
 
2292
        #   to the source of the label. This will make the output version
-
 
2293
        #   tree much prettier
-
 
2294
        #
1969
        my @opts;
2295
        my @opts;
1970
        push (@opts, '-date', $date) if ( $date );
2296
        push (@opts, '-date', $date) if ( $date );
1971
        push (@opts, '-author', $author) if ( $author );
2297
        push (@opts, '-author', $author) if ( $author );
1972
        
2298
        
1973
        JatsToolPrint ( 'jats_svnlabel',
2299
        JatsToolPrint ( 'jats_svnlabel',
Line 1991... Line 2317...
1991
#
2317
#
1992
# Returns         : 
2318
# Returns         : 
1993
#
2319
#
1994
sub endPackage
2320
sub endPackage
1995
{
2321
{
-
 
2322
    Message ("-- Import Summary ------------------------------------------------" );
1996
    RmDirTree ('SvnImportDir');
2323
    RmDirTree ('SvnImportDir');
1997
 
2324
 
1998
    #
2325
    #
1999
    #   Display versions that did get captured
2326
    #   Display versions that did get captured
2000
    #
2327
    #
Line 2010... Line 2337...
2010
    #
2337
    #
2011
    foreach my $entry ( @processOrder )
2338
    foreach my $entry ( @processOrder )
2012
    {
2339
    {
2013
        $versions{$entry}{Scanned} = 1;
2340
        $versions{$entry}{Scanned} = 1;
2014
        next if ( $versions{$entry}{TagCreated} );
2341
        next if ( $versions{$entry}{TagCreated} );
-
 
2342
        my $reason = $versions{$entry}{data}{errStr} || '';
-
 
2343
        my $tag = $versions{$entry}{vcsTag}|| 'No Tag';
2015
        Warning ("Not Processed: " . GetVname($entry) );
2344
        Warning ("Not Processed: " . GetVname($entry) . ':' . $tag . ' : ' . $reason );
2016
    }
2345
    }
2017
 
2346
 
2018
    foreach my $entry ( keys(%versions) )
2347
    foreach my $entry ( keys(%versions) )
2019
    {
2348
    {
2020
        next if ( $versions{$entry}{Scanned} );
2349
        next if ( $versions{$entry}{Scanned} );
2021
        Warning ("(E) INTERNAL ERROR. Package Not Processed: " . GetVname($entry) );
2350
        Warning ("(E) INTERNAL ERROR. Package Not Processed: " . GetVname($entry) );
2022
    }
2351
    }
2023
 
2352
 
-
 
2353
    Message ("Packages Relabled: $packageReLabelCount") if ( $packageReLabelCount );
2024
    Message ("All Done");
2354
    Message ("All Done");
2025
}
2355
}
2026
 
2356
 
2027
#-------------------------------------------------------------------------------
2357
#-------------------------------------------------------------------------------
-
 
2358
# Function        : extractFilesFromClearCase
-
 
2359
#
-
 
2360
# Description     : Extract files from ClearCase
-
 
2361
#                   May take a while as we handle nasty errors
-
 
2362
#
-
 
2363
# Inputs          : $data           - Hash of good stuff from newPackageVersionBody
-
 
2364
#                   $cc_path
-
 
2365
#                   $cc_label
-
 
2366
#
-
 
2367
# Returns         : exit code
-
 
2368
#                   Sets up
-
 
2369
#                       $data->{errStr}
-
 
2370
#                       $data->{errCode}
-
 
2371
#                   As per newPackageVersionBody
-
 
2372
#
-
 
2373
sub extractFilesFromClearCase
-
 
2374
{
-
 
2375
    my ($data, $cc_path, $cc_label) = @_;
-
 
2376
    my $tryCount = 0;
-
 
2377
    my $rv = 99;
-
 
2378
 
-
 
2379
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
-
 
2380
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
-
 
2381
    
-
 
2382
    if ( $opt_preserveProjectBase )
-
 
2383
    {
-
 
2384
        my $cc_vob = $cc_path;
-
 
2385
        $cc_vob =~ s~^/~~;
-
 
2386
        $cc_vob =~ s~/.*~~;
-
 
2387
        $data->{ViewPath} =  $data->{ViewRoot} . '/' . $cc_vob;
-
 
2388
        Message ("Preserving Project Base");
-
 
2389
    }
-
 
2390
    $data->{ViewPath} =~  tr~/~/~s;
-
 
2391
 
-
 
2392
    if ( $opt_reuse && -d $data->{ViewPath}  )
-
 
2393
    {
-
 
2394
        Message ("Reusing view: $cc_label");
-
 
2395
        return 0;
-
 
2396
    }
-
 
2397
 
-
 
2398
    while ( $rv == 99 ) {
-
 
2399
        my @args;
-
 
2400
        push (@args, '-view', $opt_name ) if ( defined $opt_name );
-
 
2401
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
-
 
2402
                    "-label=$cc_label" ,
-
 
2403
                    "-path=$cc_path",
-
 
2404
                    @args
-
 
2405
                    );
-
 
2406
 
-
 
2407
        if ( $rv == 10 ) {
-
 
2408
 
-
 
2409
            #
-
 
2410
            #   No files found
-
 
2411
            #   If this is the first time then try really hard to find them
-
 
2412
            #
-
 
2413
            unless ( $tryCount++ )
-
 
2414
            {
-
 
2415
                if ( $opt_relabel )
-
 
2416
                {
-
 
2417
                    $packageReLabelCount++;
-
 
2418
                    $rv = JatsToolPrint('cc2svn_labeldirs',
-
 
2419
                                            '-vob', $cc_path,
-
 
2420
                                            $cc_label,
-
 
2421
                                            );
-
 
2422
                    $data->{DirsLabled} = 100 + $rv;
-
 
2423
                }
-
 
2424
 
-
 
2425
                #
-
 
2426
                #   Second attempt - massage the users path
-
 
2427
                #   We should have labled up to the VOB root so lets
-
 
2428
                #   just use the VOB and not the path
-
 
2429
                #
-
 
2430
                #   If we are not relabeling then we can still do this
-
 
2431
                #   in an attempt to fix user stupidity
-
 
2432
                #
-
 
2433
                $cc_path =~ s~^/~~;
-
 
2434
                $cc_path =~ s~/.*~~;
-
 
2435
                $cc_path = '/' . $cc_path;
-
 
2436
                $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
-
 
2437
                redo;
-
 
2438
            }
-
 
2439
 
-
 
2440
            $data->{errStr}  = 'No Files in the extracted view';
-
 
2441
            $data->{errCode} = '0';
-
 
2442
            return 2;
-
 
2443
        }
-
 
2444
        elsif ( $rv == 11 ) {
-
 
2445
            $data->{errStr} = 'Label not found';
-
 
2446
            $data->{errCode} = 'L';
-
 
2447
            return 2;
-
 
2448
        }
-
 
2449
 
-
 
2450
        unless ( -d $data->{ViewPath}  )
-
 
2451
        {
-
 
2452
            $data->{errStr} = 'Failed to extract files from CC';
-
 
2453
            return 2;
-
 
2454
        }
-
 
2455
 
-
 
2456
        #
-
 
2457
        #   Looks good
-
 
2458
        #
-
 
2459
        return 0;
-
 
2460
    };
-
 
2461
 
-
 
2462
    $data->{errStr}  = 'No Files in the extracted view after labeling dirs';
-
 
2463
    $data->{errCode} = '0';
-
 
2464
    return 2;
-
 
2465
 
-
 
2466
}
-
 
2467
 
-
 
2468
#-------------------------------------------------------------------------------
2028
# Function        : detectProjectBaseUsage
2469
# Function        : detectProjectBaseUsage
2029
#
2470
#
2030
# Description     : Detect and report usage of the SetProjectBase directive
2471
# Description     : Detect and report usage of the SetProjectBase directive
2031
#
2472
#
2032
# Inputs          : $data               - Ref to a hash of bits
2473
# Inputs          : $data               - Ref to a hash of bits
Line 2072... Line 2513...
2072
 
2513
 
2073
                if ( m~^SetProjectBase~ )
2514
                if ( m~^SetProjectBase~ )
2074
                {
2515
                {
2075
                    $definesProjectBase++;
2516
                    $definesProjectBase++;
2076
                    $data->{DefinesProjectBase}++;
2517
                    $data->{DefinesProjectBase}++;
2077
                    Warning ("Package uses SetProjectBase:",
2518
                    Warning ("Package initialises SetProjectBase:",
2078
                             "Line: " . $_,
2519
                             "Line: " . $_,
2079
                             "Root: " . "$data->{ViewRoot}",
2520
                             "Root: " . "$data->{ViewRoot}",
2080
                             "File: " . "$data->{ViewRoot}/$file",
2521
                             "File: " . "$data->{ViewRoot}/$file",
2081
                            );
2522
                            );
2082
 
2523
 
Line 2104... Line 2545...
2104
                        pop @bpaths;
2545
                        pop @bpaths;
2105
                    }
2546
                    }
2106
                    unless (defined $blevel)
2547
                    unless (defined $blevel)
2107
                    {
2548
                    {
2108
                        Warning ("SetProjectBase$eSuf calculation failed - can't find build.pl");
2549
                        Warning ("SetProjectBase$eSuf calculation failed - can't find build.pl");
2109
                        $retval = 1;
2550
#                        $retval = 1;
-
 
2551
                         $definitionError++;
2110
                    }
2552
                    }
2111
                    else
2553
                    else
2112
                    {
2554
                    {
2113
                        #
2555
                        #
2114
                        #   Determine the depth of the view root
2556
                        #   Determine the depth of the view root
Line 2180... Line 2622...
2180
 
2622
 
2181
#-------------------------------------------------------------------------------
2623
#-------------------------------------------------------------------------------
2182
# Function        : findDirWithStuff
2624
# Function        : findDirWithStuff
2183
#
2625
#
2184
# Description     : Find a directory that contains more than just another subdir
2626
# Description     : Find a directory that contains more than just another subdir
-
 
2627
#                   Note: don't use 'glob' it doesn't work if the name has a space in it.
2185
#
2628
#
2186
# Inputs          : $base               - Start of the scan
2629
# Inputs          : $base               - Start of the scan
2187
#
2630
#
2188
# Returns         : Path to dir with more than just a single dir in it
2631
# Returns         : Path to dir with more than just a single dir in it
2189
#
2632
#
Line 2193... Line 2636...
2193
 
2636
 
2194
    while ( $base )
2637
    while ( $base )
2195
    {
2638
    {
2196
    my $fileCount = 0;
2639
    my $fileCount = 0;
2197
    my $dirCount = 0;
2640
    my $dirCount = 0;
-
 
2641
    my $firstDir;
2198
 
2642
 
-
 
2643
    opendir (my $dh, $base ) || Error ("Cannot opendir $base. $!");
2199
    my @list = glob( $base . '/*');
2644
    my @list =readdir $dh;
-
 
2645
    closedir $dh;
2200
    foreach ( @list )
2646
    foreach ( @list )
2201
    {
2647
    {
2202
        next if ( $_ eq '.' );
2648
        next if ( $_ eq '.' );
2203
        next if ( $_ eq '..' );
2649
        next if ( $_ eq '..' );
-
 
2650
 
-
 
2651
        $_ = $base . '/' . $_;
2204
        if ( -d $_ )
2652
        if ( -d $_ )
2205
        {
2653
        {
2206
            $dirCount++;
2654
            $dirCount++;
-
 
2655
            $firstDir = $_ unless ( defined $firstDir );
-
 
2656
            return $base
2207
            return $base if ( $dirCount > 1  );
2657
                if ( $dirCount > 1  )
2208
        }
2658
        }
2209
        else
2659
        elsif ( -e $_ )
2210
        {
2660
        {
2211
            return $base;
2661
            return $base;
2212
        }
2662
        }
-
 
2663
 
-
 
2664
        # else its probably a dead symlink
2213
    }
2665
    }
-
 
2666
 
-
 
2667
    return $base
2214
    return $base unless ( $dirCount == 1  );
2668
        unless ( $dirCount == 1  );
2215
    $base = $list[0];
2669
    $base = $firstDir;
2216
    }
2670
    }
2217
}
2671
}
2218
 
2672
 
2219
 
-
 
2220
#-------------------------------------------------------------------------------
2673
#-------------------------------------------------------------------------------
2221
# Function        : JatsToolPrint
2674
# Function        : JatsToolPrint
2222
#
2675
#
2223
# Description     : Print and Execuate a JatsTool command
2676
# Description     : Print and Execuate a JatsTool command
2224
#
2677
#
Line 2246... Line 2699...
2246
        }
2699
        }
2247
    }
2700
    }
2248
    return $me;
2701
    return $me;
2249
}
2702
}
2250
 
2703
 
-
 
2704
#-------------------------------------------------------------------------------
-
 
2705
# Function        : saneLabel
-
 
2706
#
-
 
2707
# Description     : Generate a sane version label
-
 
2708
#                   Handle suplicates (due to character squishing)
-
 
2709
#                   Cache results for repeatability
-
 
2710
#
-
 
2711
# Inputs          : $entry          - Version info
-
 
2712
#                   $pkgname        - Alternate pkgname (branching)
-
 
2713
#
-
 
2714
# Returns         : Sane string
-
 
2715
#
2251
sub saneLabel
2716
sub saneLabel
2252
{
2717
{
2253
    my ($entry, $pkgname) = @_;
2718
    my ($entry, $pkgname) = @_;
2254
    my $me;
2719
    my $me;
-
 
2720
    $me = $versions{$entry}{vname};
-
 
2721
    $pkgname = $versions{$entry}{name} unless ( defined $pkgname );
2255
 
2722
 
-
 
2723
    #
-
 
2724
    #   If we have calculated it, then reuse it.
-
 
2725
    #
2256
    if ( $versions{$entry}{realLabel} )
2726
    if ( exists $versions{$entry}{saneLabel}{$pkgname} )
2257
    {
2727
    {
2258
        $me = $versions{$entry}{realLabel};
2728
        return $versions{$entry}{saneLabel}{$pkgname};
2259
        return $me;
-
 
2260
    }
2729
    }
2261
    $me = $versions{$entry}{vname};
-
 
2262
    $pkgname = $versions{$entry}{name} unless ( defined $pkgname );
-
 
-
 
2730
 
2263
 
2731
 
2264
    Error ("Package does have a version string: pvid: $entry")
2732
    Error ("Package does have a version string: pvid: $entry")
2265
        unless ( defined $me );
2733
        unless ( defined $me );
2266
 
2734
 
2267
    #
2735
    #
Line 2282... Line 2750...
2282
    $me = $pkgname . '_' . $me;
2750
    $me = $pkgname . '_' . $me;
2283
    $me =~ tr~ ~-~s;
2751
    $me =~ tr~ ~-~s;
2284
    $me =~ tr~-~-~s;
2752
    $me =~ tr~-~-~s;
2285
    $me =~ tr~_~_~s;
2753
    $me =~ tr~_~_~s;
2286
 
2754
 
-
 
2755
    #
-
 
2756
    #   Due to some sillyness ( package version starting with _ )
-
 
2757
    #   we may get duplicates. Detect and allocate different numbers
-
 
2758
    #
-
 
2759
    if ( exists $saneLabels{$me} )
-
 
2760
    {
-
 
2761
        $saneLabels{$me}++;
-
 
2762
        $me = $me . '.' . $saneLabels{$me};
-
 
2763
        Message ("Duplicate SaneLabel resolved as: $me");
-
 
2764
    }
-
 
2765
    else
-
 
2766
    {
-
 
2767
        $saneLabels{$me} = 0;
-
 
2768
    }
-
 
2769
 
-
 
2770
    #
-
 
2771
    #   Cache value
-
 
2772
    #
-
 
2773
    $versions{$entry}{saneLabel}{$pkgname} = $me;
2287
    return $me;
2774
    return $me;
2288
}
2775
}
2289
 
2776
 
-
 
2777
sub saneString
-
 
2778
{
-
 
2779
    my ($string) = @_;
-
 
2780
    #
-
 
2781
    #   Get rid of multiple '_'
-
 
2782
    #   Replace space with -
-
 
2783
    #
-
 
2784
    $string =~ s~\W~_~g;
-
 
2785
    $string =~ tr~ ~_~s;
-
 
2786
    $string =~ tr~_-~-~s;
-
 
2787
    $string =~ tr~-_~-~s;
-
 
2788
    $string =~ tr~-~-~s;
-
 
2789
    $string =~ tr~_~_~s;
-
 
2790
    $string =~ s~-$~~;
-
 
2791
    $string =~ s~_$~~;
-
 
2792
 
-
 
2793
    return $string;
-
 
2794
}
-
 
2795
 
2290
 
2796
 
2291
exit 0;
2797
exit 0;
2292
 
2798
 
2293
 
2799
 
2294
#-------------------------------------------------------------------------------
2800
#-------------------------------------------------------------------------------
Line 2369... Line 2875...
2369
    connectRM(\$RM_DB) unless ( $RM_DB );
2875
    connectRM(\$RM_DB) unless ( $RM_DB );
2370
 
2876
 
2371
    #
2877
    #
2372
    #   Extract data from Release Manager
2878
    #   Extract data from Release Manager
2373
    #
2879
    #
-
 
2880
    my $m_sqlstr = "SELECT " .
-
 
2881
                       "pkg.PKG_NAME, " .                                       # row[0]
-
 
2882
                       "pv.PKG_VERSION, " .                                     # row[1]
-
 
2883
                       "pkg.PKG_ID, " .                                         # row[2]
-
 
2884
                       "pv.PV_ID, " .                                           # row[3]
-
 
2885
                       "pv.LAST_PV_ID, " .                                      # row[4]
-
 
2886
                       "pv.MODIFIED_STAMP, " .                                  # row[5]
2374
    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 ".
2887
                       "release_manager.PK_RMAPI.return_vcs_tag(pv.PV_ID), " .  # row[6]
2375
                   " FROM RELEASE_MANAGER.PACKAGES pkg, RELEASE_MANAGER.PACKAGE_VERSIONS pv, ACCESS_MANAGER.USERS amu" .
2888
                       "amu.USER_NAME, " .                                      # row[7]
-
 
2889
                       "pv.COMMENTS, " .                                        # row[8]
-
 
2890
                       "pv.DLOCKED, " .                                         # row[9]
-
 
2891
                       "pv.CREATOR_ID, ".                                       # row[10]
2376
                   " WHERE pv.PKG_ID = \'$pkg_id\' AND pkg.PKG_ID = pv.PKG_ID AND amu.USER_ID (+) = pv.CREATOR_ID";
2892
                       "pv.BUILD_TYPE ".                                        # row[11]
2377
                   
2893
                   " FROM " .
-
 
2894
                        "RELEASE_MANAGER.PACKAGES pkg, " .
-
 
2895
                        "RELEASE_MANAGER.PACKAGE_VERSIONS pv, " .
-
 
2896
                        "ACCESS_MANAGER.USERS amu" .
2378
                   
2897
                   " WHERE " .
-
 
2898
                        "pv.PKG_ID = \'$pkg_id\' " .
-
 
2899
                        "AND pkg.PKG_ID = pv.PKG_ID " .
-
 
2900
                        "AND amu.USER_ID (+) = pv.CREATOR_ID";
-
 
2901
 
2379
    my $sth = $RM_DB->prepare($m_sqlstr);
2902
    my $sth = $RM_DB->prepare($m_sqlstr);
2380
    if ( defined($sth) )
2903
    if ( defined($sth) )
2381
    {
2904
    {
2382
        if ( $sth->execute( ) )
2905
        if ( $sth->execute( ) )
2383
        {
2906
        {
Line 2396... Line 2919...
2396
                    my $vcstag =  $row[6] || 'Unknown';
2919
                    my $vcstag =  $row[6] || 'Unknown';
2397
 
2920
 
2398
                    my $created_id =  $row[7] || ($row[10] ? "Userid_$row[10]" :'Unknown');
2921
                    my $created_id =  $row[7] || ($row[10] ? "Userid_$row[10]" :'Unknown');
2399
                    my $comment =  $row[8] || '';
2922
                    my $comment =  $row[8] || '';
2400
                    my $locked =  $row[9] || 'N';
2923
                    my $locked =  $row[9] || 'N';
-
 
2924
                    my $manual = $row[11] || 'M';
2401
 
2925
 
2402
                    #
2926
                    #
2403
                    #   Some developers have a 'special' package version
2927
                    #   Some developers have a 'special' package version
2404
                    #   We really need to ignore them
2928
                    #   We really need to ignore them
2405
                    #
2929
                    #
Line 2419... Line 2943...
2419
                    $versions{$pv_id}{comment} = $comment;
2943
                    $versions{$pv_id}{comment} = $comment;
2420
                    $versions{$pv_id}{locked} = $locked;
2944
                    $versions{$pv_id}{locked} = $locked;
2421
                    $versions{$pv_id}{TimeStamp} = str2time( $created );
2945
                    $versions{$pv_id}{TimeStamp} = str2time( $created );
2422
                    $versions{$pv_id}{Age} = ($now - $versions{$pv_id}{TimeStamp}) / (60 * 60 * 24);
2946
                    $versions{$pv_id}{Age} = ($now - $versions{$pv_id}{TimeStamp}) / (60 * 60 * 24);
2423
                    $versions{$pv_id}{TooOld} = 1 if ( $opt_age && $opt_age <= $versions{$pv_id}{Age} );
2947
                    $versions{$pv_id}{TooOld} = 1 if ( $opt_age && $opt_age <= $versions{$pv_id}{Age} );
-
 
2948
                    $versions{$pv_id}{BuildType} = $manual;
2424
                    examineVcsTag($pv_id);
2949
                    examineVcsTag($pv_id);
2425
 
2950
 
2426
                    #
2951
                    #
2427
                    #   Process version number
2952
                    #   Process version number
2428
                    #
2953
                    #
2429
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion ) = massageVersion($pkg_ver, $pkg_name);
2954
                    my ($suffix, $version, $isaR, $isaWip, $buildVersion ) = massageVersion($pkg_ver, $pkg_name);
2430
 
2955
 
2431
                    $versions{$pv_id}{version} = $version;
2956
                    $versions{$pv_id}{version} = $version;
2432
                    $versions{$pv_id}{buildVersion} = $buildVersion;
2957
                    $versions{$pv_id}{buildVersion} = $buildVersion;
2433
                    $versions{$pv_id}{isaRipple} = 1 if ( $isaR );
-
 
2434
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
2958
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
2435
 
2959
 
2436
                    #
2960
                    #
-
 
2961
                    #   New methof for detecting a ripple
-
 
2962
                    #       Don't look at the version number
-
 
2963
                    #       Use RM data
-
 
2964
                    #       Inlude the comment - there are some cases where the comment
-
 
2965
                    #       appears to have been user modified.
-
 
2966
                    #
-
 
2967
#                    $versions{$pv_id}{isaRipple} = 1 if ( $isaR );
-
 
2968
#                    $versions{$pv_id}{isaRipple} = 1 if ( uc($manual) eq 'Y' );
-
 
2969
                    $versions{$pv_id}{isaRipple} = ( $comment =~ m~^Rippled Build~i && ( uc($manual) eq 'Y' ));
-
 
2970
 
-
 
2971
                    #
2437
                    #   Process suffix
2972
                    #   Process suffix
2438
                    #
2973
                    #
2439
                    $suffix = 'Unknown' unless ( $suffix );
2974
                    $suffix = 'Unknown' unless ( $suffix );
2440
                    $suffix = lc ($suffix);
2975
                    $suffix = lc ($suffix);
2441
                    $versions{$pv_id}{suffix} = $suffix;
2976
                    $versions{$pv_id}{suffix} = $suffix;
Line 2695... Line 3230...
2695
{
3230
{
2696
    my ($tag) = @_;
3231
    my ($tag) = @_;
2697
    $tag =~ tr~\\/~/~;
3232
    $tag =~ tr~\\/~/~;
2698
    if ( $tag =~ m~^CC::~ )
3233
    if ( $tag =~ m~^CC::~ )
2699
    {
3234
    {
-
 
3235
        $tag =~ s~CC::load\s+~CC::~;                # Load rule
-
 
3236
        $tag =~ s~CC::\s+~CC::~;                    # Leading white space
-
 
3237
        $tag =~ s~CC::[A-Za-z]\:/~CC::/~;           # Leading driver letter
-
 
3238
        $tag =~ s~CC::/+~CC::/~;                    # Multiple initial /'s
-
 
3239
        $tag =~ s~/build.pl::~::~i;
2700
        $tag =~ s~CC::\s+~CC::~;
3240
        $tag =~ s~/src::~::~i;
2701
        $tag =~ s~MASS_Dev_Bus/Cbp/~MASS_Dev_Bus/CBP/~i;
3241
        $tag =~ s~MASS_Dev_Bus/Cbp/~MASS_Dev_Bus/CBP/~i;
2702
        $tag =~ s~MASS_Dev_Bus~MASS_Dev_Bus~i;
3242
        $tag =~ s~MASS_Dev_Bus~MASS_Dev_Bus~i;
2703
        $tag =~ s~/MASS_Dev/Infra~MASS_Dev_Infra~i;
3243
        $tag =~ s~/MASS_Dev/Infra~MASS_Dev_Infra~i;
2704
        $tag =~ s~/MASS_Dev/Bus/web~/MASS_Dev_Bus/web~i;
3244
        $tag =~ s~/MASS_Dev/Bus/web~/MASS_Dev_Bus/web~i;
2705
 
3245
 
Line 2792... Line 3332...
2792
#
3332
#
2793
sub createImages
3333
sub createImages
2794
{
3334
{
2795
 
3335
 
2796
    my $filebase = "${packageNames}";
3336
    my $filebase = "${packageNames}";
2797
    open (FH, '>', "$filebase.dot" ) or die "Cannot open output";
3337
    open (FH, '>', $cwd . "/$filebase.dot" ) or die "Cannot open output";
2798
    print FH "digraph \"${packageNames}\" {\n";
3338
    print FH "digraph \"${packageNames}\" {\n";
2799
    #print FH "rankdir=LR;\n";
3339
    #print FH "rankdir=LR;\n";
2800
    print FH "node[fontsize=16];\n";
3340
    print FH "node[fontsize=16];\n";
2801
    print FH "node[target=_graphviz];\n";
3341
    print FH "node[target=_graphviz];\n";
2802
#    print FH "subgraph cluster_A {\n";
3342
#    print FH "subgraph cluster_A {\n";
Line 2835... Line 3375...
2835
        push @text, 'Bad Singletions : ' . $badSingletonCount;
3375
        push @text, 'Bad Singletions : ' . $badSingletonCount;
2836
        push @text, 'Deadwood entries : ' . $trimCount;
3376
        push @text, 'Deadwood entries : ' . $trimCount;
2837
        push @text, 'Walking Mode : Flat' if ($opt_flat);
3377
        push @text, 'Walking Mode : Flat' if ($opt_flat);
2838
        push @text, 'Pruned Mode : ' . $pruneModeString;
3378
        push @text, 'Pruned Mode : ' . $pruneModeString;
2839
        push @text, 'Pruned entries : ' . $pruneCount;
3379
        push @text, 'Pruned entries : ' . $pruneCount;
-
 
3380
        push @text, 'Recent entries : ' . $recentCount;
2840
 
3381
 
2841
        if ( @unknownProjects )
3382
        if ( @unknownProjects )
2842
        {
3383
        {
2843
            push @text, '|';
3384
            push @text, '|';
2844
            push @text, 'Unknown Projects';
3385
            push @text, 'Unknown Projects';
Line 2873... Line 3414...
2873
            push @text, '|';
3414
            push @text, '|';
2874
            push @text, 'Subversion';
3415
            push @text, 'Subversion';
2875
            push @text, 'Trunk used' if exists $svnData{branches}{trunk} ;
3416
            push @text, 'Trunk used' if exists $svnData{branches}{trunk} ;
2876
            push @text, 'Labels: ' . scalar keys %{$svnData{tags}} ;
3417
            push @text, 'Labels: ' . scalar keys %{$svnData{tags}} ;
2877
            push @text, 'Branches: ' . scalar keys %{$svnData{branches}} ;
3418
            push @text, 'Branches: ' . scalar keys %{$svnData{branches}} ;
-
 
3419
            push @text, 'Relabled Packages : ' . $packageReLabelCount;
2878
        }
3420
        }
2879
 
3421
 
2880
        push @text, '';
3422
        push @text, '';
2881
        my $text = join '\l', @text;
3423
        my $text = join '\l', @text;
2882
        $text =~ s~\|\\l~|~g;
3424
        $text =~ s~\|\\l~|~g;
Line 2911... Line 3453...
2911
        push @text, 'd: A dependency';
3453
        push @text, 'd: A dependency';
2912
        push @text, 'B: Bad VCS Tag';
3454
        push @text, 'B: Bad VCS Tag';
2913
        push @text, 'D: DeadWood';
3455
        push @text, 'D: DeadWood';
2914
        push @text, 'e: Essential BOM Version';
3456
        push @text, 'e: Essential BOM Version';
2915
        push @text, 'E: Essential Release Version';
3457
        push @text, 'E: Essential Release Version';
-
 
3458
        push @text, 'F: Package directories labled';
2916
        push @text, 'G: Glued into Version Tree';
3459
        push @text, 'G: Glued into Version Tree';
-
 
3460
        push @text, 'L: Label not in VOB';
-
 
3461
        push @text, 'r: Recent version';
-
 
3462
        push @text, 'R: Ripple';
2917
        push @text, 'S: Splitpoint';
3463
        push @text, 'S: Splitpoint';
2918
        push @text, 't: Glued into Project Tree';
3464
        push @text, 't: Glued into Project Tree';
2919
        push @text, 'T: Tip version';
3465
        push @text, 'T: Tip version';
2920
        push @text, 'V: In SVN';
3466
        push @text, 'V: In SVN';
2921
        push @text, '+: In Subversion';
3467
        push @text, '+: In Subversion';
-
 
3468
        push @text, '0: Zero files extracted';
2922
        push @text, '}}';
3469
        push @text, '}}';
2923
 
3470
 
2924
        push @text, '|';
3471
        push @text, '|';
2925
        push @text, 'Outline';
3472
        push @text, 'Outline';
2926
        push @text, 'Red: Dead or Bad VCS Tag';
3473
        push @text, 'Red: Dead or Bad VCS Tag';
2927
        push @text, 'Orange: Project Branch Root';
3474
        push @text, 'Orange: Project Branch Root';
2928
        push @text, 'Green: Ripple Build Version';
3475
        push @text, 'Green: Ripple Build Version';
2929
        push @text, 'Blue: Essential Version';
3476
        push @text, 'Blue: Essential Version';
2930
        push @text, 'Darkmagenta: Entry Glued into tree';
3477
        push @text, 'Darkmagenta: Entry Glued into tree';
2931
        push @text, 'Magenta: Entry added to project tree';
3478
        push @text, 'Magenta: Entry added to project tree';
-
 
3479
        push @text, 'DeepPink: Label not in VOB';
-
 
3480
        push @text, 'DarkViolet: Zero files extracted';
2932
 
3481
 
2933
 
3482
 
2934
        push @text, '|';
3483
        push @text, '|';
2935
        push @text, 'Fill';
3484
        push @text, 'Fill';
2936
        push @text, 'PowderBlue: Essential Version';
3485
        push @text, 'PowderBlue: Essential Version';
Line 3000... Line 3549...
3000
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
3549
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
3001
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
3550
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
3002
#        $stateText .= 'E' if (exists $versions{$entry}{Essential});
3551
#        $stateText .= 'E' if (exists $versions{$entry}{Essential});
3003
        $stateText .= $reason if ( $reason );
3552
        $stateText .= $reason if ( $reason );
3004
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
3553
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
-
 
3554
        $stateText .= 'R' if ( $versions{$entry}{isaRipple} );
-
 
3555
        $stateText .= 'r' if (exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
3005
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
3556
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
3006
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
3557
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
3007
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
3558
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
3008
        $stateText .= '+' if (exists $versions{$entry}{svnVersion} );
3559
        $stateText .= '+' if (exists $versions{$entry}{svnVersion} );
-
 
3560
        $stateText .= '0' if (exists $versions{$entry}{data}{errCode} && $versions{$entry}{data}{errCode} eq '0');
-
 
3561
        $stateText .= 'L' if (exists $versions{$entry}{data}{errCode} && $versions{$entry}{data}{errCode} eq 'L');
-
 
3562
        $stateText .= 'F' if ($versions{$entry}{data}{DirsLabled});
-
 
3563
 
-
 
3564
 
3009
#        $stateText .= 's' if (exists $versions{$entry}{branchPoint} );
3565
#        $stateText .= 's' if (exists $versions{$entry}{branchPoint} );
3010
#        $stateText .= ' T='. $versions{$entry}{threadId} if (exists $versions{$entry}{threadId});
3566
#        $stateText .= ' T='. $versions{$entry}{threadId} if (exists $versions{$entry}{threadId});
3011
#        $stateText .= ' EssentalPath' if (exists $versions{$entry}{EssentialPath});
3567
#        $stateText .= ' EssentalPath' if (exists $versions{$entry}{EssentialPath});
3012
#        $stateText .= ' Count='. $versions{$entry}{EssentialSplitPoint} if (exists $versions{$entry}{EssentialSplitPoint});
3568
#        $stateText .= ' Count='. $versions{$entry}{EssentialSplitPoint} if (exists $versions{$entry}{EssentialSplitPoint});
3013
#        $stateText .= ' M='. $versions{$entry}{maxVersion} if (exists $versions{$entry}{maxVersion});
3569
#        $stateText .= ' M='. $versions{$entry}{maxVersion} if (exists $versions{$entry}{maxVersion});
3014
 
3570
 
3015
        push @label, "(${stateText})" if ( $stateText );
3571
        push @label, "(${stateText})" if ( length($stateText) );
-
 
3572
 
-
 
3573
##       Insert Release Names
-
 
3574
        foreach my $rtag_id ( keys %{$versions{$entry}{Releases}}  ) {
-
 
3575
            next unless ( exists $ukHopsReleases{$rtag_id} );
-
 
3576
            push @label, "Release: $versions{$entry}{Releases}{$rtag_id}{rname}";
-
 
3577
        }
3016
 
3578
 
3017
        return join ('\n', @label );
3579
        return join ('\n', @label );
3018
    }
3580
    }
3019
 
3581
 
3020
    sub genAttributes
3582
    sub genAttributes
Line 3046... Line 3608...
3046
           $color = 'color=orange style=bold' if ( $versions{$entry}{newSuffix} );
3608
           $color = 'color=orange style=bold' if ( $versions{$entry}{newSuffix} );
3047
           $color = 'color=red style=bold' if ( $versions{$entry}{DeadWood} || $versions{$entry}{badVcsTag} );
3609
           $color = 'color=red style=bold' if ( $versions{$entry}{DeadWood} || $versions{$entry}{badVcsTag} );
3048
           $color = 'color=blue style=bold' if ( $versions{$entry}{Essential} );
3610
           $color = 'color=blue style=bold' if ( $versions{$entry}{Essential} );
3049
           $color = 'color=darkmagenta style=bold' if ( $versions{$entry}{GluedIn} );
3611
           $color = 'color=darkmagenta style=bold' if ( $versions{$entry}{GluedIn} );
3050
           $color = 'color=magenta style=bold' if ( $versions{$entry}{MakeTree} );
3612
           $color = 'color=magenta style=bold' if ( $versions{$entry}{MakeTree} );
-
 
3613
           $color = 'color=DeepPink style=bold' if (exists $versions{$entry}{data}{errCode} && $versions{$entry}{data}{errCode} eq 'L');
-
 
3614
           $color = 'color=DarkViolet style=bold' if (exists $versions{$entry}{data}{errCode} && $versions{$entry}{data}{errCode} eq '0');
3051
 
3615
 
3052
           $fill = 'style=filled fillcolor=powderblue' if ( $versions{$entry}{Essential} );
3616
           $fill = 'style=filled fillcolor=powderblue' if ( $versions{$entry}{Essential} );
3053
           $fill = 'style=filled fillcolor=red' if ( $versions{$entry}{Essential} && $versions{$entry}{badVcsTag} );
3617
           $fill = 'style=filled fillcolor=red' if ( $versions{$entry}{Essential} && $versions{$entry}{badVcsTag} );
3054
           $fill = 'style=filled fillcolor="#99FF99"' if ( exists $versions{$entry}{svnVersion} );
3618
           $fill = 'style=filled fillcolor="#99FF99"' if ( exists $versions{$entry}{svnVersion} );
3055
 
3619
 
Line 3266... Line 3830...
3266
        push @EssentialPackages, $_;
3830
        push @EssentialPackages, $_;
3267
        Error ("Essential Package Version not in extracted Release Manager Data: $_")
3831
        Error ("Essential Package Version not in extracted Release Manager Data: $_")
3268
            unless ( exists $versions{$_} );
3832
            unless ( exists $versions{$_} );
3269
        $versions{$_}{Essential} = 1;
3833
        $versions{$_}{Essential} = 1;
3270
        $versions{$_}{Reason} = $ScmPackages{$_}{Reason};
3834
        $versions{$_}{Reason} = $ScmPackages{$_}{Reason};
-
 
3835
 
-
 
3836
        # Retain which RM Release this package-version is the tip
-
 
3837
        # Release of
-
 
3838
        foreach my $rtag_id ( @{$ScmPackages{$_}{'release'}} )
-
 
3839
        {
-
 
3840
            $versions{$_}{Releases}{$rtag_id}{rname}   = $ScmReleases{$rtag_id}{name};
-
 
3841
            $versions{$_}{Releases}{$rtag_id}{pname}   = $ScmReleases{$rtag_id}{pName};
-
 
3842
            $versions{$_}{Releases}{$rtag_id}{proj_id} = $ScmReleases{$rtag_id}{proj_id};
-
 
3843
        }
-
 
3844
        
3271
#print "ESSENTIAL: $versions{$_}{name} $versions{$_}{vname} $versions{$_}{Reason}\n";
3845
        #print "ESSENTIAL: $versions{$_}{name} $versions{$_}{vname}\n";
3272
    }
3846
    }
3273
 
3847
 
3274
    #
3848
    #
3275
    #   Free memory
3849
    #   Free memory
3276
    #
3850
    #
Line 3415... Line 3989...
3415
            $fromBranch = 'trunk';
3989
            $fromBranch = 'trunk';
3416
        } elsif ( $entry->{fromPath} =~ m~/branches/(.*)~ ) {
3990
        } elsif ( $entry->{fromPath} =~ m~/branches/(.*)~ ) {
3417
            $fromBranch = $1;
3991
            $fromBranch = $1;
3418
        }
3992
        }
3419
 
3993
 
-
 
3994
        # largest Rev number on branch
3420
        if ( defined($fromBranch) && ! exists $svnData{branches}{$fromBranch} )
3995
        if ( exists $svnData{max}{$fromBranch} )
3421
        {
3996
        {
3422
            unless ( $name eq $fromBranch )
3997
            if ( $svnData{max}{$fromBranch}{rev} <  $entry->{fromRev} )
3423
            {
3998
            {
3424
                $svnData{branches}{$fromBranch} = $name;
3999
                $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
3425
                $svnData{tips}{$name} = $fromBranch;
4000
                $svnData{max}{$fromBranch}{name} = $name;
3426
            }
4001
            }
3427
        }
4002
        }
-
 
4003
        else
-
 
4004
        {
-
 
4005
            $svnData{max}{$fromBranch}{rev} =  $entry->{fromRev};
-
 
4006
            $svnData{max}{$fromBranch}{name} = $name;
-
 
4007
        }
-
 
4008
    }
-
 
4009
 
-
 
4010
    foreach my $branch ( keys %{$svnData{max}} )
-
 
4011
    {
-
 
4012
        $svnData{tips}{$svnData{max}{$branch}{name}} = $branch;
3428
    }
4013
    }
-
 
4014
#    DebugDumpData("svnDataItems", \@svnDataItems);
3429
#    DebugDumpData("SvnData", \%svnData);
4015
#    DebugDumpData("SvnData", \%svnData);
3430
 
4016
 
-
 
4017
 
3431
    foreach my $entry ( keys(%versions) )
4018
    foreach my $entry ( keys(%versions) )
3432
    {
4019
    {
3433
        my $import_label = saneLabel($entry);
4020
        my $import_label = saneLabel($entry);
3434
        delete $versions{$entry}{svnVersion};
4021
        delete $versions{$entry}{svnVersion};
3435
        delete $versions{$entry}{svnBranchTip};
4022
        delete $versions{$entry}{svnBranchTip};
Line 3443... Line 4030...
3443
        {
4030
        {
3444
            $versions{$entry}{svnBranchTip} = $svnData{tips}{$import_label};
4031
            $versions{$entry}{svnBranchTip} = $svnData{tips}{$import_label};
3445
        }
4032
        }
3446
    }
4033
    }
3447
 
4034
 
3448
    Message ( 'Trunk used: ' . (exists $svnData{branches}{trunk} ? 'Yes' : 'No') );
4035
    Message ( 'Trunk used: ' . (exists $svnData{'max'}{trunk} ? 'Yes' : 'No') );
3449
    Message ( 'Labels    : ' . scalar keys %{$svnData{tags}} );
4036
    Message ( 'Labels    : ' . scalar keys %{$svnData{tags}} );
3450
    Message ( 'Branches  : ' . scalar keys %{$svnData{branches}} );
4037
    Message ( 'Branches  : ' . scalar keys %{$svnData{'max'}} );
3451
}
4038
}
3452
 
4039
 
3453
#-------------------------------------------------------------------------------
4040
#-------------------------------------------------------------------------------
3454
# Function        : ProcessSvnLog
4041
# Function        : ProcessSvnLog
3455
#
4042
#
Line 3506... Line 4093...
3506
    #
4093
    #
3507
    #   Return 0 to keep on going
4094
    #   Return 0 to keep on going
3508
    return 0;
4095
    return 0;
3509
}
4096
}
3510
 
4097
 
3511
 
-
 
3512
 
-
 
3513
#-------------------------------------------------------------------------------
4098
#-------------------------------------------------------------------------------
3514
# Function        : saveData
4099
# Function        : saveData
3515
#
4100
#
3516
# Description     : Save essential data
4101
# Description     : Save essential data
3517
#
4102
#
Line 3563... Line 4148...
3563
            my $pkg_name = $1;
4148
            my $pkg_name = $1;
3564
            my $pkg_ver = $2;
4149
            my $pkg_ver = $2;
3565
            $pkg_ver =~ s~^[a-zA-Z]\.*~~;
4150
            $pkg_ver =~ s~^[a-zA-Z]\.*~~;
3566
print "$data[2] : $pkg_name, $pkg_ver\n";
4151
print "$data[2] : $pkg_name, $pkg_ver\n";
3567
 
4152
 
3568
#           Expecting Clearcase format: 2011-08-30T13:49:21+08
4153
#           Expecting Clearcase format:
-
 
4154
#               2011-08-30T13:49:21+08
-
 
4155
#               2010-11-16T03:24:34Z
3569
#           Need 'YYYY-MM-DDTHH:MM:SS.M'
4156
#           Need 'YYYY-MM-DDTHH:MM:SS.M'
3570
            my $cdate = $data[0];
4157
            my $cdate = $data[0];
3571
            $cdate =~ s~ ~T~;
4158
            $cdate =~ s~ ~T~;
3572
            $cdate =~ s~\+.*~~;
4159
            $cdate =~ s~\+.*~~;
-
 
4160
            $cdate =~ s~Z+.*~~;
3573
            $cdate .= '.00';
4161
            $cdate .= '.00';
3574
 
4162
 
3575
            $pv_id++;
4163
            $pv_id++;
3576
#            $versions{$pv_id}{fileListEntry} = $_;
4164
#            $versions{$pv_id}{fileListEntry} = $_;
3577
            $versions{$pv_id}{name} = $pkg_name;
4165
            $versions{$pv_id}{name} = $pkg_name;
Line 3646... Line 4234...
3646
    -name=aaa          - Alternate output package name. Test Only
4234
    -name=aaa          - Alternate output package name. Test Only
3647
    -[no]log           - Write output to log file. Def: -nolog
4235
    -[no]log           - Write output to log file. Def: -nolog
3648
    -[no]postimage     - Create image after transger: Def: -post
4236
    -[no]postimage     - Create image after transger: Def: -post
3649
    -workdir=path      - Use for temp storage (def:/work)
4237
    -workdir=path      - Use for temp storage (def:/work)
3650
    -delete            - Delete SVN package before test
4238
    -delete            - Delete SVN package before test
-
 
4239
    -[no]relabel       - Attempt to relabel dirs in packages that don't extract
-
 
4240
    -filelist=path     - Use named list of files
3651
 
4241
 
3652
=head1 OPTIONS
4242
=head1 OPTIONS
3653
 
4243
 
3654
=over 8
4244
=over 8
3655
 
4245