Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
2427 dpurdie 1
########################################################################
6177 dpurdie 2
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
2427 dpurdie 3
#
4
# Module name   : jats_rm_play24.pl
5
# Module type   : Makefile system
6
# Compiler(s)   : n/a
7
# Environment(s): jats
8
#
9
# Description   : Test if a package is in subversion
10
#
11
#
12
#......................................................................#
13
 
14
require 5.006_001;
15
use strict;
16
use warnings;
17
use JatsError;
18
use JatsSystem;
19
use Getopt::Long;
20
use Pod::Usage;                             # required for help support
21
use JatsRmApi;
22
 
23
use DBI;
24
 
25
my $VERSION = "1.2.3";                      # Update this
26
my $opt_verbose = 1;
27
my $opt_help = 0;
28
my $opt_manual;
29
my $RM_DB;
30
my $DM_DB;
31
 
32
#-------------------------------------------------------------------------------
33
# Function        : Main Entry
34
#
35
# Description     :
36
#
37
# Inputs          :
38
#
39
# Returns         :
40
#
41
my $result = GetOptions (
42
                "help+"         => \$opt_help,          # flag, multiple use allowed
43
                "manual"        => \$opt_manual,        # flag
44
                "verbose+"      => \$opt_verbose,       # flag
45
                );
46
 
47
#
48
#   Process help and manual options
49
#
50
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
51
pod2usage(-verbose => 1)  if ($opt_help == 2 );
52
pod2usage(-verbose => 2)  if ($opt_manual || ($opt_help > 2));
53
 
54
 
55
ErrorConfig( 'name'    =>'PLAY26' );
56
 
57
getInSubversion( 210 );
58
 
59
sub getInSubversion
60
{
61
    my ($pkg_id ) = @_;
62
    my $found = 0;
63
    my @rows;
64
 
65
    connectRM(\$RM_DB) unless $RM_DB;
66
    #
67
    #   Now extract the package dependacies
68
    #
69
    my $m_sqlstr = "SELECT COUNT(*)".
70
                  " FROM  ".
71
                  "         RELEASE_MANAGER.PACKAGE_VERSIONS pv ".
72
                  " WHERE ".
73
                  "         pv.PKG_ID = $pkg_id" .
74
                  "         AND pv.VCS_TYPE_ID = 24" .
75
                  "";
76
$m_sqlstr =~ s~\s+~ ~g;
77
print "\n\n$m_sqlstr\n";
78
    my $sth = $RM_DB->prepare($m_sqlstr);
79
    if ( defined($sth) )
80
    {
81
        if ( $sth->execute( ) )
82
        {
83
            if ( $sth->rows )
84
            {
85
                while ( my @row = $sth->fetchrow_array )
86
                {
87
                    print "-- @row\n";
88
                    $found = 1;
89
                }
90
            }
91
            $sth->finish();
92
        }
93
        else
94
        {
95
            Error("GetDepends:Execute failure: $m_sqlstr", $sth->errstr() );
96
        }
97
    }
98
    else
99
    {
100
        Error("GetDepends:Prepare failure" );
101
    }
102
 
103
    unless ( $found )
104
    {
105
        Warning("No Package Version data for: $pkg_id");
106
    }
107
}
108