Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
392 dpurdie 1
#! perl
2
########################################################################
3
# Copyright ( C ) 2004 ERG Limited, All rights reserved
4
#
5
# Module name   : jats.sh
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
8
# Environment(s): jats
9
#
10
# Description   : Display the packages that have a 'bad' Buildtype
11
#
12
# Usage:
13
#
14
# Version   Who      Date        Description
15
#
16
#......................................................................#
17
 
18
require 5.006_001;
19
use strict;
20
use warnings;
21
use JatsError;
22
use JatsRmApi;
23
 
24
#use Data::Dumper;
25
use DBI;
26
use Cwd;
27
 
28
my $GBE_PERL     = $ENV{'GBE_PERL'};        # Essential ENV variables
29
my $GBE_CORE     = $ENV{'GBE_CORE'};
30
my $opt_verbose = 1;
31
my $RM_DB;
32
my @GDATA;
33
 
34
sub getPkgDetailsByRTAG_ID
35
{
36
    my ($RTAG_ID) = @_;
37
    my (@row);
38
 
39
    # if we are not or cannot connect then return 0 as we have not found anything
40
    connectRM(\$RM_DB) unless ( $RM_DB );
41
 
42
    # First get details from pv_id
43
 
44
    my $m_sqlstr = "SELECT pbe.PV_ID, pbe.BE_ID, pkg.PKG_NAME, pv.PKG_VERSION, be.BE_NAME, pv.PKG_LABEL, pbe.BUILD_TYPE" .
45
                   " FROM PACKAGE_BUILD_ENV pbe, PACKAGE_VERSIONS pv, PACKAGES pkg, BUILD_ENVIRONMENTS be, RELEASE_CONTENT rc" .
46
                   " WHERE pbe.BUILD_TYPE >= 0 AND pv.PV_ID = pbe.PV_ID AND pv.PKG_ID = pkg.PKG_ID AND be.BE_ID = pbe.BE_ID AND rc.RTAG_ID = $RTAG_ID AND rc.PV_ID = pv.PV_ID" .
47
                   " ORDER BY pkg.PKG_NAME, pv.PKG_VERSION";
48
    my $sth = $RM_DB->prepare($m_sqlstr);
49
    if ( defined($sth) )
50
    {
51
        if ( $sth->execute( ) )
52
        {
53
            if ( $sth->rows )
54
            {
55
                while ( @row = $sth->fetchrow_array )
56
                {
57
                    printf "%40s %-20s %-80s - %s(%s)\n", $row[2], $row[3], $row[5], $row[4], $row[6];
58
                }
59
            }
60
            $sth->finish();
61
        }
62
    }
63
    else
64
    {
65
        Error("Prepare failure" );
66
    }
67
}
68
 
69
#-------------------------------------------------------------------------------
70
# Function        : Main
71
#
72
# Description     :
73
#
74
# Inputs          :
75
#
76
# Returns         :
77
#
78
 
79
ErrorConfig( 'name'    =>'PLAY8' );
80
 
81
 
82
#getRtagId();
83
 
84
#getPkgDetailsByRTAG_ID(3645);           # 3645 : SLS 2.03d
85
#getPkgDetailsByRTAG_ID(2301);           # 2301 : Seattle I7
86
getPkgDetailsByRTAG_ID(2362);           # 2362 : Syd Release 1
87
#getPkgDetailsByRTAG_ID(1861);           # 1861 : Syd Release Legacy
88
#getPkgDetailsByRTAG_ID(2641);           # 2641 : NZS Phase-1
89
 
90
exit;
91
 
92
 
93