2 # checknewapi - a perl script to check for new API's
3 # using two outputs from regview and dump the interscetion
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
11 die "usage: checknewapi <new_type_library> <reference_type_library> <buildinfodescr> <fullpath_regview>\n";
14 -e
"$ARGV[0]" || die "ERROR: type library \"$ARGV[0]\" does not exist\n";
15 -e
"$ARGV[1]" || die "ERROR: reference type library \"$ARGV[1]\" does not exist\n";
16 -e
"$ARGV[3]" || die "ERROR: invalid path to the regview tool \"$ARGV[3]\", please specify the full qualified path\n";
21 $main::buildinfo
= "$ARGV[2]";
22 $main::regview
= "$ARGV[3]";
23 %{$main::reftypes
} = ();
24 %{$main::currenttypes
} = ();
25 %{$main::removedtypes
} = ();
27 open ( FILEIN
, "$main::regview \"$ARGV[0]\" |" ) || die "could not use content of current typelibrary \"$ARGV[0]\", regview doesn't work\n";
31 open( CURRENT
, ">current_types.txt" ) || die "\nERROR: could not open current_types.txt for writing";
42 if ( $linebefore =~ m
#type class: published (.+)# )
46 } elsif ( $linebefore =~ m
#type class: (.+)# )
60 if ( (!$typeclass eq "") && ($_ =~ m
# *type name: \"([^\[.]+)\"#) )
66 if ( ! exists $main::currenttypes
->{$1} )
68 $main::currenttypes
->{$1} = { PUBLISHED
=> $published,
69 TYPECLASS
=> $typeclass,
71 # print "### $main::currenttypes->{$1}->{PUBLISHED} $main::currenttypes->{$1}->{TYPECLASS} $main::currenttypes->{$1}->{COUNT}\n";
79 open ( FILEIN
, "$main::regview \"$ARGV[1]\" |" ) || die "could not use content of reference type library \"$ARGV[1]\", regview doesn't work\n";
83 open( REFERENCE
, ">reference_types.txt" ) || die "\nERROR: could not open reference_types.txt for writing";
95 if ( $linebefore =~ m
#type class: published (.+)# )
99 } elsif ( $linebefore =~ m
#type class: (.+)# )
113 if ( (!$typeclass eq "") && ($_ =~ m
# *type name: \"([^\[.]+)\"#) )
117 print REFERENCE
"$1\n";
119 if ( ! exists $main::reftypes
->{$1} )
121 $main::reftypes
->{$1}++;
123 if ( exists $main::currenttypes
->{$1} )
125 $main::currenttypes
->{$1}->{COUNT
}++;
126 # print "###### $main::currenttypes->{$1}->{PUBLISHED} $main::currenttypes->{$1}->{TYPECLASS} $main::currenttypes->{$1}->{COUNT}\n";
131 $main::removedtypes
->{$1} = { PUBLISHED
=> $published,
132 TYPECLASS
=> $typeclass };
135 print "ERROR: type $1 is only in reference type library, this can't be happen\n";
146 @typekeys = keys %{$main::currenttypes
};
147 $allunotypes = $#typekeys+1;
151 $draftspublished = 0;
152 foreach $i ( sort @typekeys )
154 if ( $main::currenttypes
->{$i}->{COUNT
} == 1 &&
155 !("$main::currenttypes->{$i}->{TYPECLASS}" eq "module"))
160 if ($main::currenttypes
->{$i}->{PUBLISHED
} == 1)
165 if ( $t =~ m
#drafts\.com.+#)
168 if ($main::currenttypes
->{$i}->{PUBLISHED
} == 1)
173 print "$main::currenttypes->{$i}->{TYPECLASS} = $t\n";
177 # count removed not yet published types
178 $removednotpublished = 0;
180 @removedtypekeys = keys %{$main::removedtypes
};
181 foreach $i ( sort @removedtypekeys )
183 $removednotpublished++;
186 print "removed not yet published $main::currenttypes->{$i}->{TYPECLASS} = $t\n";
189 print "\n=======================================================\n\n";
190 print "Summary [last check for $main::buildinfo]:\n\n";
191 print "Number of UNO types = $allunotypes\n";
192 print "Number of new UNO types = $newunotypes\n";
193 print "New and published types = $newpublished\n";
194 print "New and draft types = $draftscount\n";
195 print "New, draft and published = $draftspublished\n";
196 print "Removed and not published = $removednotpublished\n";