Subversion Repositories DevTools

Rev

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

Rev 2476 Rev 2548
Line 172... Line 172...
172
} else {
172
} else {
173
    Error ("Mode not specified: all, hops, standard");
173
    Error ("Mode not specified: all, hops, standard");
174
}
174
}
175
 
175
 
176
GetAllPackageNames();
176
GetAllPackageNames();
-
 
177
getPackagesInSvn();
177
getReleaseDetails();
178
getReleaseDetails();
178
getPkgDetailsByRTAG_ID();
179
getPkgDetailsByRTAG_ID();
179
my ($pcount, $vcount) = countPackages();
180
my ($pcount, $vcount) = countPackages();
180
print "Directly referenced Packages: $pcount Versions: $vcount\n";
181
print "Directly referenced Packages: $pcount Versions: $vcount\n";
181
LocateStrays() unless ($opt_quick);
182
LocateStrays() unless ($opt_quick);
Line 197... Line 198...
197
($pcount, $vcount) = countPackages();
198
($pcount, $vcount) = countPackages();
198
print "Total References Packages: $pcount Versions: $vcount\n";
199
print "Total References Packages: $pcount Versions: $vcount\n";
199
exit;
200
exit;
200
 
201
 
201
#-------------------------------------------------------------------------------
202
#-------------------------------------------------------------------------------
-
 
203
# Function        : getPackagesInSvn
-
 
204
#
-
 
205
# Description     : Determine packages that have been migrated
-
 
206
#                   Done by looking up RM for any version that has been migrated
-
 
207
#
-
 
208
# Inputs          : 
-
 
209
#
-
 
210
# Returns         : 
-
 
211
#
-
 
212
sub getPackagesInSvn
-
 
213
{
-
 
214
    my (@row);
-
 
215
 
-
 
216
    # if we are not or cannot connect then return 0 as we have not found anything
-
 
217
    connectRM(\$RM_DB) unless $RM_DB;
-
 
218
 
-
 
219
    # First get all packages that are referenced in a Release
-
 
220
    # This will only get the top level packages
-
 
221
    # From non-archived releases
-
 
222
 
-
 
223
    my $m_sqlstr = "SELECT UNIQUE" .
-
 
224
                        " pv.PKG_ID ".                                         #[0]
-
 
225
                   " FROM RELEASE_MANAGER.PACKAGE_VERSIONS pv".
-
 
226
                   " WHERE pv.VCS_TYPE_ID=23";
-
 
227
    my $sth = $RM_DB->prepare($m_sqlstr);
-
 
228
    if ( defined($sth) )
-
 
229
    {
-
 
230
        if ( $sth->execute( ) )
-
 
231
        {
-
 
232
#            print "--- Execute\n";
-
 
233
            if ( $sth->rows )
-
 
234
            {
-
 
235
                #print "--- Execute ROWS\n";
-
 
236
                while ( @row = $sth->fetchrow_array )
-
 
237
                {
-
 
238
                    my $id = $row[0];
-
 
239
                    next unless ( $id );
-
 
240
                    $AllPackages{$id}{inSvn} = 1;
-
 
241
#print "Data: @row\n";
-
 
242
                }
-
 
243
            }
-
 
244
#            print "--- Finish\n";
-
 
245
            $sth->finish();
-
 
246
        }
-
 
247
        else
-
 
248
        {
-
 
249
            Error("Execute failure: $m_sqlstr", $sth->errstr() );
-
 
250
        }
-
 
251
    }
-
 
252
    else
-
 
253
    {
-
 
254
        Error("Prepare failure" );
-
 
255
    }
-
 
256
    
-
 
257
}
-
 
258
 
-
 
259
#-------------------------------------------------------------------------------
202
# Function        : getReleaseDetails
260
# Function        : getReleaseDetails
203
#
261
#
204
# Description     : Determine all candiate releases
262
# Description     : Determine all candiate releases
205
#
263
#
206
# Inputs          : 
264
# Inputs          : 
Line 571... Line 629...
571
                while ( my @row = $sth->fetchrow_array )
629
                while ( my @row = $sth->fetchrow_array )
572
                {
630
                {
573
                    my $id = $row[0];
631
                    my $id = $row[0];
574
                    my $name = $row[1];
632
                    my $name = $row[1];
575
                    next unless ( $id );
633
                    next unless ( $id );
576
                    $AllPackages{$id} = $name;
634
                    $AllPackages{$id}{name} = $name;
577
                }
635
                }
578
            }
636
            }
579
            $sth->finish();
637
            $sth->finish();
580
        }
638
        }
581
        else
639
        else
Line 822... Line 880...
822
 
880
 
823
 
881
 
824
#-------------------------------------------------------------------------------
882
#-------------------------------------------------------------------------------
825
# Function        : LocateStrays
883
# Function        : LocateStrays
826
#
884
#
827
# Description     :
885
# Description     : Locate stray packages
-
 
886
#                   Try to do several at a time to speed up processing
828
#
887
#
829
# Inputs          :
888
# Inputs          :
830
#
889
#
831
# Returns         :
890
# Returns         :
832
#
891
#