Subversion Repositories DevTools

Rev

Rev 7299 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
392 dpurdie 1
#! perl
2
########################################################################
7300 dpurdie 3
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
392 dpurdie 4
#
5
# Module name   : jats.sh
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
8
# Environment(s): jats
9
#
10
# Description   : Not sure
11
#
12
#
13
# Usage:
14
#
15
# Version   Who      Date        Description
16
#
17
#......................................................................#
18
 
19
require 5.006_001;
20
use strict;
21
use warnings;
22
use JatsError;
23
use JatsSystem;
24
use Getopt::Long;
25
use Pod::Usage;                             # required for help support
26
use JatsRmApi;
27
use JatsVersionUtils;
28
 
29
use DBI;
30
 
31
my $VERSION = "1.2.3";                      # Update this
32
my $opt_verbose = 1;
33
my $opt_help = 0;
34
my $opt_manual;
35
my $opt_rtag_id;
36
my $RM_DB;
37
 
38
#
39
#   Package information
40
#
41
my %Package;
42
my %Dnr;
43
my @StrayPackages;
44
 
45
#-------------------------------------------------------------------------------
46
# Function        : Main Entry
47
#
48
# Description     :
49
#
50
# Inputs          :
51
#
52
# Returns         :
53
#
54
my $result = GetOptions (
55
                "help+"         => \$opt_help,          # flag, multiple use allowed
56
                "manual"        => \$opt_manual,        # flag
57
                "verbose+"      => \$opt_verbose,       # flag
58
                "rtag=s"        => \$opt_rtag_id,       # string
59
                );
60
 
61
#
62
#   Process help and manual options
63
#
64
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
65
pod2usage(-verbose => 1)  if ($opt_help == 2 );
66
pod2usage(-verbose => 2)  if ($opt_manual || ($opt_help > 2));
67
 
68
 
69
my%pi;
70
my %data;
71
 
72
ErrorConfig( 'name'    =>'PLAY21' );
73
getStuffedEntried();
74
 
75
exit;
76
 
77
 
78
sub  getStuffedEntried
79
{
80
    my $foundDetails = 0;
81
    my (@row);
82
 
83
    # if we are not or cannot connect then return 0 as we have not found anything
84
    connectRM( \$RM_DB);
85
 
86
    # First get details from pv_id
87
 
88
    my $m_sqlstr = "select RELEASE_MANAGER.PACKAGE_VERSIONS.PV_ID, RELEASE_MANAGER.PACKAGE_VERSIONS.PKG_LABEL, RELEASE_MANAGER.PACKAGE_VERSIONS.SRC_PATH, RELEASE_MANAGER.PACKAGE_VERSIONS.PKG_VERSION " .
89
                    "from RELEASE_MANAGER.PACKAGE_VERSIONS, RELEASE_MANAGER.PACKAGE_METRICS " .
90
                    "where RELEASE_MANAGER.PACKAGE_VERSIONS.PV_ID = RELEASE_MANAGER.PACKAGE_METRICS.PV_ID and RELEASE_MANAGER.PACKAGE_METRICS.BRANCH_LIST is null";
91
    my $sth = $RM_DB->prepare($m_sqlstr);
92
    if ( defined($sth) )
93
    {
94
        if ( $sth->execute( ) )
95
        {
96
            if ( $sth->rows )
97
            {
98
                while ( @row = $sth->fetchrow_array )
99
                {
100
                    my $pvid = $row[0];
101
                    my $path = $row[2];
102
                    $path =~ s~\\~/~g;
103
                    my $label = $row[1];
104
                    my $version = $row[3];
105
 
106
 
107
                    #
108
                    #   Skip those where the source path is the vob root
109
                    #
110
                    my $count = $path =~ s~/~/~g;
111
                    next if ( $count <= 1 );
112
 
113
                    #
114
                    #   Skip those that arn't a ripple
115
                    #
116
                    my ( $major, $minor, $patch, $build, $raw_patch ) = SplitVersion( $version );
117
                    next if ( $build <= 0 );
118
 
119
                    $data{$pvid}{vn} = "$major, $minor, $patch, $build, $raw_patch";
120
                    $data{$pvid}{label} = $label;
121
                    $data{$pvid}{path} = $path;
122
 
123
                    if ( exists $pi{$path} )
124
                    {
125
                        $pi{$path}{count} ++;
126
                    }
127
                    else
128
                    {
129
                        $pi{$path}{count} = 1;
130
                        $pi{$path}{pvid} = $pvid;
131
                    }
132
 
133
#                    printf ("$major, $minor, $patch, $build, $raw_patch, $count : %40.40s %s\n", $label, $path);
134
 
135
#print "Data: @row\n";
136
                }
137
            }
138
            $sth->finish();
139
        }
140
    }
141
    else
142
    {
143
        Error("Prepare failure" );
144
    }
145
 
146
 
147
    #
148
    #   Now print out those that have only been rippled once
149
    #
150
    foreach my $path ( keys %pi )
151
    {
152
        next unless ( $pi{$path}{count} == 1 );
153
        my $pvid = $pi{$path}{pvid};
154
 
155
        my $label = $data{$pvid}{label};
156
        my $path =  $data{$pvid}{path};
157
        my $vn = $data{$pvid}{vn};
158
 
159
#        printf ("%-40.40s %s     - $vn\n", $label, $path);
160
 
161
#        print "jats.bat release -test -label=$label -path=$path\n";
162
 
163
        my $label_old = $label;
164
        $label_old =~ s~(...)(\.[a-z]+)$~000$2~;
165
        print "jats.bat CCdiff -old=$label_old -new=$label\n";
166
 
167
 
168
    }
169
 
170
}
171