-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindnotbuilt.pl
More file actions
executable file
·88 lines (84 loc) · 2.44 KB
/
findnotbuilt.pl
File metadata and controls
executable file
·88 lines (84 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/opt/etrade/p6/bin/perl -w
#
# findnotbuilt.pl - a script to compare your installed et_* RPM's with the
# main source codebase of maven builds and figure out
# what's left to build.
# Needs Number::Compare and File::Find::Rule installed
# as a pre-req
#
# Jeff Leggett, April 2008
use strict;
use warnings;
use File::Find::Rule;
sub getRPM_name {
my $A = `rpm -q --queryformat '%{NAME}' $_`;
return $A;
}
#
# Change this variable to point to your top level working directory
#
my $MAINTRUNK = "/etrade/home/jleggett/work/3p-stb";
my @EM, my @P6;
#
# Find all installed ^et_ RPM's and get their name and branch
#
open PKGS, "rpm -q -g \"Maven 2.0\" |" or die "can't fork: $!";
while (<PKGS>) {
my $PKG = $_;
(my $A,my $B,my $C) = split /_/, $PKG, 3;
chop($C);
my $PKGNAME = getRPM_name($PKG);
(my $D,my $E,my $F) = split /_/, $PKGNAME, 3;
if ($B eq "em") {
push(@EM, $F);
}
if ($B eq "p6") {
push(@P6, $F);
}
next;
}
close PKGS;
# Search both branches - for directories with pom.xml in them.
my $RULE = File::Find::Rule->new;
$RULE->file;
$RULE->name( 'pom.xml' );
my @P6FILES = $RULE->in( "$MAINTRUNK/p6/" );
my @EMFILES = $RULE->in( "$MAINTRUNK/em/" );
# Remove any directories with a pom.xml in them in target subdiri
# and the pom.xml file itself from the main dir
foreach my $AREF (@P6FILES) {
if ( $AREF =~ m/target/ ) { $AREF = ""; next; }
$AREF =~ s/\/pom.xml//;
}
@P6FILES = sort(@P6FILES);
foreach my $AREF (@EMFILES) {
if ( $AREF =~ m/target/ ) { $AREF = ""; next; }
$AREF =~ s/\/pom.xml//;
}
@EMFILES = sort(@EMFILES);
foreach my $AREF (@P6FILES) {
if ( $AREF eq "" ) { shift(@P6FILES); }
}
foreach my $AREF (@EMFILES) {
if ( $AREF eq "" ) { shift(@EMFILES); }
}
use File::Basename;
my %P6SEEN = ();
my @P6NOTBUILT = ();
foreach my $ITEM (@P6) { $P6SEEN{$ITEM} = 1; }
foreach my $PKG (@P6FILES) {
my $BASENAME = basename($PKG);
unless ($P6SEEN{$BASENAME}) { push (@P6NOTBUILT, $PKG); }
}
my %EMSEEN = ();
my @EMNOTBUILT = ();
foreach my $ITEM (@EM) { $EMSEEN{$ITEM} = 1; }
foreach my $PKG (@EMFILES) {
my $BASENAME = basename($PKG);
unless ($EMSEEN{$BASENAME}) { push (@EMNOTBUILT, $PKG); }
}
print "$MAINTRUNK/P6 Packages not built:\n";
foreach my $AREF (@P6NOTBUILT) { print $AREF . "\n"; }
print "\n\n";
print "$MAINTRUNK/EM Packages not built:\n";
foreach my $AREF (@EMNOTBUILT) { print $AREF . "\n"; }