office-gobmx/offapi/util/checknewapi.pl

199 lines
5.4 KiB
Perl
Raw Normal View History

#
# checknewapi - a perl script to check for new API's
# using two outputs from regview and dump the interscetion
# of new types
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
CWS-TOOLING: integrate CWS jsc320 2009-07-31 11:40:04 +0200 jsc r274518 : #103926# apply patch 2009-07-16 17:17:01 +0200 jsc r274063 : #i103311# check new Solaris compiler version ox5100 2009-07-07 17:20:41 +0200 jsc r273811 : cleanup 2009-07-07 15:21:26 +0200 jsc r273799 : #98322# correct LD_LIBRARY_PATH, sdk/lib dir instead of sdkout/platfrom/lib, all unix excepting mac 2009-07-07 15:07:05 +0200 jsc r273798 : #i98322# correct link 2009-07-07 09:43:57 +0200 jsc r273773 : #i98322# correct link path 2009-07-06 15:49:07 +0200 jsc r273749 : #i98322# correct typo 2009-07-06 14:17:27 +0200 jsc r273743 : #i103311# support sunstudio compiler 12u1, version 5.10 (which results in 0x5100) 2009-07-03 13:54:58 +0200 jsc r273693 : #i96576# support opensolaris and enhance docu to relfect usage of gmake 2009-07-02 13:12:02 +0200 jsc r273643 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:11:30 +0200 jsc r273642 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:05:35 +0200 jsc r273640 : #i103260# correct typo for windows 2009-07-02 13:01:34 +0200 jsc r273639 : #i103260# provide regview with path as argument 2009-07-01 07:18:01 +0200 jsc r273541 : CWS-TOOLING: rebase CWS jsc320 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 08:01:13 +0200 jsc r273485 : #98322# include import purpenvhelper lib under windows 2009-06-10 15:07:29 +0200 jsc r272815 : CWS-TOOLING: rebase CWS jsc320 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 09:36:23 +0200 jsc r272329 : #i98322# create link for purpenvhelper library in SDK 2009-05-27 09:35:41 +0200 jsc r272328 : #i98322# create link for purpenvhelpr library in SDK 2009-05-14 16:19:41 +0200 jsc r271900 : increase version number in SDK header image 2009-05-14 16:11:05 +0200 jsc r271899 : #i101408# new version 3.2 2009-05-14 15:33:47 +0200 jsc r271894 : #i99163# apply patch to correct wrong tags for autodoc 2009-05-14 14:49:58 +0200 jsc r271889 : #i99707# apply patch to remove unused code
2009-08-06 02:01:05 -05:00
if($#ARGV != 3)
{
CWS-TOOLING: integrate CWS jsc320 2009-07-31 11:40:04 +0200 jsc r274518 : #103926# apply patch 2009-07-16 17:17:01 +0200 jsc r274063 : #i103311# check new Solaris compiler version ox5100 2009-07-07 17:20:41 +0200 jsc r273811 : cleanup 2009-07-07 15:21:26 +0200 jsc r273799 : #98322# correct LD_LIBRARY_PATH, sdk/lib dir instead of sdkout/platfrom/lib, all unix excepting mac 2009-07-07 15:07:05 +0200 jsc r273798 : #i98322# correct link 2009-07-07 09:43:57 +0200 jsc r273773 : #i98322# correct link path 2009-07-06 15:49:07 +0200 jsc r273749 : #i98322# correct typo 2009-07-06 14:17:27 +0200 jsc r273743 : #i103311# support sunstudio compiler 12u1, version 5.10 (which results in 0x5100) 2009-07-03 13:54:58 +0200 jsc r273693 : #i96576# support opensolaris and enhance docu to relfect usage of gmake 2009-07-02 13:12:02 +0200 jsc r273643 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:11:30 +0200 jsc r273642 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:05:35 +0200 jsc r273640 : #i103260# correct typo for windows 2009-07-02 13:01:34 +0200 jsc r273639 : #i103260# provide regview with path as argument 2009-07-01 07:18:01 +0200 jsc r273541 : CWS-TOOLING: rebase CWS jsc320 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 08:01:13 +0200 jsc r273485 : #98322# include import purpenvhelper lib under windows 2009-06-10 15:07:29 +0200 jsc r272815 : CWS-TOOLING: rebase CWS jsc320 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 09:36:23 +0200 jsc r272329 : #i98322# create link for purpenvhelper library in SDK 2009-05-27 09:35:41 +0200 jsc r272328 : #i98322# create link for purpenvhelpr library in SDK 2009-05-14 16:19:41 +0200 jsc r271900 : increase version number in SDK header image 2009-05-14 16:11:05 +0200 jsc r271899 : #i101408# new version 3.2 2009-05-14 15:33:47 +0200 jsc r271894 : #i99163# apply patch to correct wrong tags for autodoc 2009-05-14 14:49:58 +0200 jsc r271889 : #i99707# apply patch to remove unused code
2009-08-06 02:01:05 -05:00
die "usage: checknewapi <new_type_library> <reference_type_library> <buildinfodescr> <fullpath_regview>\n";
}
-e "$ARGV[0]" || die "ERROR: type library \"$ARGV[0]\" does not exist\n";
-e "$ARGV[1]" || die "ERROR: reference type library \"$ARGV[1]\" does not exist\n";
CWS-TOOLING: integrate CWS jsc320 2009-07-31 11:40:04 +0200 jsc r274518 : #103926# apply patch 2009-07-16 17:17:01 +0200 jsc r274063 : #i103311# check new Solaris compiler version ox5100 2009-07-07 17:20:41 +0200 jsc r273811 : cleanup 2009-07-07 15:21:26 +0200 jsc r273799 : #98322# correct LD_LIBRARY_PATH, sdk/lib dir instead of sdkout/platfrom/lib, all unix excepting mac 2009-07-07 15:07:05 +0200 jsc r273798 : #i98322# correct link 2009-07-07 09:43:57 +0200 jsc r273773 : #i98322# correct link path 2009-07-06 15:49:07 +0200 jsc r273749 : #i98322# correct typo 2009-07-06 14:17:27 +0200 jsc r273743 : #i103311# support sunstudio compiler 12u1, version 5.10 (which results in 0x5100) 2009-07-03 13:54:58 +0200 jsc r273693 : #i96576# support opensolaris and enhance docu to relfect usage of gmake 2009-07-02 13:12:02 +0200 jsc r273643 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:11:30 +0200 jsc r273642 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:05:35 +0200 jsc r273640 : #i103260# correct typo for windows 2009-07-02 13:01:34 +0200 jsc r273639 : #i103260# provide regview with path as argument 2009-07-01 07:18:01 +0200 jsc r273541 : CWS-TOOLING: rebase CWS jsc320 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 08:01:13 +0200 jsc r273485 : #98322# include import purpenvhelper lib under windows 2009-06-10 15:07:29 +0200 jsc r272815 : CWS-TOOLING: rebase CWS jsc320 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 09:36:23 +0200 jsc r272329 : #i98322# create link for purpenvhelper library in SDK 2009-05-27 09:35:41 +0200 jsc r272328 : #i98322# create link for purpenvhelpr library in SDK 2009-05-14 16:19:41 +0200 jsc r271900 : increase version number in SDK header image 2009-05-14 16:11:05 +0200 jsc r271899 : #i101408# new version 3.2 2009-05-14 15:33:47 +0200 jsc r271894 : #i99163# apply patch to correct wrong tags for autodoc 2009-05-14 14:49:58 +0200 jsc r271889 : #i99707# apply patch to remove unused code
2009-08-06 02:01:05 -05:00
-e "$ARGV[3]" || die "ERROR: invalid path to the regview tool \"$ARGV[3]\", please specify the full qualified path\n";
# debug flag
$DEBUG = 0;
$main::buildinfo = "$ARGV[2]";
CWS-TOOLING: integrate CWS jsc320 2009-07-31 11:40:04 +0200 jsc r274518 : #103926# apply patch 2009-07-16 17:17:01 +0200 jsc r274063 : #i103311# check new Solaris compiler version ox5100 2009-07-07 17:20:41 +0200 jsc r273811 : cleanup 2009-07-07 15:21:26 +0200 jsc r273799 : #98322# correct LD_LIBRARY_PATH, sdk/lib dir instead of sdkout/platfrom/lib, all unix excepting mac 2009-07-07 15:07:05 +0200 jsc r273798 : #i98322# correct link 2009-07-07 09:43:57 +0200 jsc r273773 : #i98322# correct link path 2009-07-06 15:49:07 +0200 jsc r273749 : #i98322# correct typo 2009-07-06 14:17:27 +0200 jsc r273743 : #i103311# support sunstudio compiler 12u1, version 5.10 (which results in 0x5100) 2009-07-03 13:54:58 +0200 jsc r273693 : #i96576# support opensolaris and enhance docu to relfect usage of gmake 2009-07-02 13:12:02 +0200 jsc r273643 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:11:30 +0200 jsc r273642 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:05:35 +0200 jsc r273640 : #i103260# correct typo for windows 2009-07-02 13:01:34 +0200 jsc r273639 : #i103260# provide regview with path as argument 2009-07-01 07:18:01 +0200 jsc r273541 : CWS-TOOLING: rebase CWS jsc320 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 08:01:13 +0200 jsc r273485 : #98322# include import purpenvhelper lib under windows 2009-06-10 15:07:29 +0200 jsc r272815 : CWS-TOOLING: rebase CWS jsc320 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 09:36:23 +0200 jsc r272329 : #i98322# create link for purpenvhelper library in SDK 2009-05-27 09:35:41 +0200 jsc r272328 : #i98322# create link for purpenvhelpr library in SDK 2009-05-14 16:19:41 +0200 jsc r271900 : increase version number in SDK header image 2009-05-14 16:11:05 +0200 jsc r271899 : #i101408# new version 3.2 2009-05-14 15:33:47 +0200 jsc r271894 : #i99163# apply patch to correct wrong tags for autodoc 2009-05-14 14:49:58 +0200 jsc r271889 : #i99707# apply patch to remove unused code
2009-08-06 02:01:05 -05:00
$main::regview = "$ARGV[3]";
%{$main::reftypes} = ();
%{$main::currenttypes} = ();
%{$main::removedtypes} = ();
CWS-TOOLING: integrate CWS jsc320 2009-07-31 11:40:04 +0200 jsc r274518 : #103926# apply patch 2009-07-16 17:17:01 +0200 jsc r274063 : #i103311# check new Solaris compiler version ox5100 2009-07-07 17:20:41 +0200 jsc r273811 : cleanup 2009-07-07 15:21:26 +0200 jsc r273799 : #98322# correct LD_LIBRARY_PATH, sdk/lib dir instead of sdkout/platfrom/lib, all unix excepting mac 2009-07-07 15:07:05 +0200 jsc r273798 : #i98322# correct link 2009-07-07 09:43:57 +0200 jsc r273773 : #i98322# correct link path 2009-07-06 15:49:07 +0200 jsc r273749 : #i98322# correct typo 2009-07-06 14:17:27 +0200 jsc r273743 : #i103311# support sunstudio compiler 12u1, version 5.10 (which results in 0x5100) 2009-07-03 13:54:58 +0200 jsc r273693 : #i96576# support opensolaris and enhance docu to relfect usage of gmake 2009-07-02 13:12:02 +0200 jsc r273643 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:11:30 +0200 jsc r273642 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:05:35 +0200 jsc r273640 : #i103260# correct typo for windows 2009-07-02 13:01:34 +0200 jsc r273639 : #i103260# provide regview with path as argument 2009-07-01 07:18:01 +0200 jsc r273541 : CWS-TOOLING: rebase CWS jsc320 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 08:01:13 +0200 jsc r273485 : #98322# include import purpenvhelper lib under windows 2009-06-10 15:07:29 +0200 jsc r272815 : CWS-TOOLING: rebase CWS jsc320 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 09:36:23 +0200 jsc r272329 : #i98322# create link for purpenvhelper library in SDK 2009-05-27 09:35:41 +0200 jsc r272328 : #i98322# create link for purpenvhelpr library in SDK 2009-05-14 16:19:41 +0200 jsc r271900 : increase version number in SDK header image 2009-05-14 16:11:05 +0200 jsc r271899 : #i101408# new version 3.2 2009-05-14 15:33:47 +0200 jsc r271894 : #i99163# apply patch to correct wrong tags for autodoc 2009-05-14 14:49:58 +0200 jsc r271889 : #i99707# apply patch to remove unused code
2009-08-06 02:01:05 -05:00
open ( FILEIN, "$main::regview \"$ARGV[0]\" |" ) || die "could not use content of current typelibrary \"$ARGV[0]\", regview doesn't work\n";
if ($DEBUG == 1)
{
open( CURRENT, ">current_types.txt" ) || die "\nERROR: could not open current_types.txt for writing";
}
$first = 1;
$linebefore = "";
$published = 0;
$typeclass = "";
while (<FILEIN>)
{
if ($first == 0)
{
if ( $linebefore =~ m#type class: published (.+)# )
{
$published = 1;
$typeclass = $1;
} elsif ( $linebefore =~ m#type class: (.+)# )
{
$published = 0;
$typeclass = $1;
} else
{
$published = 0;
$typeclass = "";
}
} else
{
$first = 0;
}
if ( (!$typeclass eq "") && ($_ =~ m# *type name: \"([^\[.]+)\"#) )
{
if ($DEBUG == 1)
{
print CURRENT "$1\n";
}
if ( ! exists $main::currenttypes->{$1} )
{
$main::currenttypes->{$1} = { PUBLISHED => $published,
TYPECLASS => $typeclass,
COUNT => 1 };
# print "### $main::currenttypes->{$1}->{PUBLISHED} $main::currenttypes->{$1}->{TYPECLASS} $main::currenttypes->{$1}->{COUNT}\n";
}
}
$linebefore = $_;
}
close( FILEIN );
close( CURRENT );
CWS-TOOLING: integrate CWS jsc320 2009-07-31 11:40:04 +0200 jsc r274518 : #103926# apply patch 2009-07-16 17:17:01 +0200 jsc r274063 : #i103311# check new Solaris compiler version ox5100 2009-07-07 17:20:41 +0200 jsc r273811 : cleanup 2009-07-07 15:21:26 +0200 jsc r273799 : #98322# correct LD_LIBRARY_PATH, sdk/lib dir instead of sdkout/platfrom/lib, all unix excepting mac 2009-07-07 15:07:05 +0200 jsc r273798 : #i98322# correct link 2009-07-07 09:43:57 +0200 jsc r273773 : #i98322# correct link path 2009-07-06 15:49:07 +0200 jsc r273749 : #i98322# correct typo 2009-07-06 14:17:27 +0200 jsc r273743 : #i103311# support sunstudio compiler 12u1, version 5.10 (which results in 0x5100) 2009-07-03 13:54:58 +0200 jsc r273693 : #i96576# support opensolaris and enhance docu to relfect usage of gmake 2009-07-02 13:12:02 +0200 jsc r273643 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:11:30 +0200 jsc r273642 : #i103260# improve fix by using EXECPOST variable 2009-07-02 13:05:35 +0200 jsc r273640 : #i103260# correct typo for windows 2009-07-02 13:01:34 +0200 jsc r273639 : #i103260# provide regview with path as argument 2009-07-01 07:18:01 +0200 jsc r273541 : CWS-TOOLING: rebase CWS jsc320 to trunk@273468 (milestone: DEV300:m51) 2009-06-30 08:01:13 +0200 jsc r273485 : #98322# include import purpenvhelper lib under windows 2009-06-10 15:07:29 +0200 jsc r272815 : CWS-TOOLING: rebase CWS jsc320 to trunk@272291 (milestone: DEV300:m49) 2009-05-27 09:36:23 +0200 jsc r272329 : #i98322# create link for purpenvhelper library in SDK 2009-05-27 09:35:41 +0200 jsc r272328 : #i98322# create link for purpenvhelpr library in SDK 2009-05-14 16:19:41 +0200 jsc r271900 : increase version number in SDK header image 2009-05-14 16:11:05 +0200 jsc r271899 : #i101408# new version 3.2 2009-05-14 15:33:47 +0200 jsc r271894 : #i99163# apply patch to correct wrong tags for autodoc 2009-05-14 14:49:58 +0200 jsc r271889 : #i99707# apply patch to remove unused code
2009-08-06 02:01:05 -05:00
open ( FILEIN, "$main::regview \"$ARGV[1]\" |" ) || die "could not use content of reference type library \"$ARGV[1]\", regview doesn't work\n";
if ($DEBUG == 1)
{
open( REFERENCE, ">reference_types.txt" ) || die "\nERROR: could not open reference_types.txt for writing";
}
# reset variables
$first = 1;
$linebefore = "";
$published = 0;
$typeclass = "";
while (<FILEIN>)
{
if ($first == 0)
{
if ( $linebefore =~ m#type class: published (.+)# )
{
$published = 1;
$typeclass = $1;
} elsif ( $linebefore =~ m#type class: (.+)# )
{
$published = 0;
$typeclass = $1;
} else
{
$published = 0;
$typeclass = "";
}
} else
{
$first = 0;
}
if ( (!$typeclass eq "") && ($_ =~ m# *type name: \"([^\[.]+)\"#) )
{
if ($DEBUG == 1)
{
print REFERENCE "$1\n";
}
if ( ! exists $main::reftypes->{$1} )
{
$main::reftypes->{$1}++;
if ( exists $main::currenttypes->{$1} )
{
$main::currenttypes->{$1}->{COUNT}++;
# print "###### $main::currenttypes->{$1}->{PUBLISHED} $main::currenttypes->{$1}->{TYPECLASS} $main::currenttypes->{$1}->{COUNT}\n";
} else
{
if ($published == 0)
{
$main::removedtypes->{$1} = { PUBLISHED => $published,
TYPECLASS => $typeclass };
} else
{
print "ERROR: type $1 is only in reference type library, this can't be happen\n";
}
}
}
}
$linebefore = $_;
}
close( FILEIN );
close( REFERENCE );
@typekeys = keys %{$main::currenttypes};
$allunotypes = $#typekeys+1;
$newunotypes = 0;
$newpublished = 0;
$draftscount = 0;
$draftspublished = 0;
foreach $i ( sort @typekeys )
{
if ( $main::currenttypes->{$i}->{COUNT} == 1 &&
!("$main::currenttypes->{$i}->{TYPECLASS}" eq "module"))
{
$newunotypes++;
my $t = $i;
$t =~ s#/#\.#go;
if ($main::currenttypes->{$i}->{PUBLISHED} == 1)
{
print "published ";
$newpublished++;
}
if ( $t =~ m#drafts\.com.+#)
{
$draftscount++;
if ($main::currenttypes->{$i}->{PUBLISHED} == 1)
{
$draftspublished++;
}
}
print "$main::currenttypes->{$i}->{TYPECLASS} = $t\n";
}
}
# count removed not yet published types
$removednotpublished = 0;
@removedtypekeys = keys %{$main::removedtypes};
foreach $i ( sort @removedtypekeys )
{
$removednotpublished++;
my $t = $i;
$t =~ s#/#\.#go;
print "removed not yet published $main::currenttypes->{$i}->{TYPECLASS} = $t\n";
}
print "\n=======================================================\n\n";
print "Summary [last check for $main::buildinfo]:\n\n";
print "Number of UNO types = $allunotypes\n";
print "Number of new UNO types = $newunotypes\n";
print "New and published types = $newpublished\n";
print "New and draft types = $draftscount\n";
print "New, draft and published = $draftspublished\n";
print "Removed and not published = $removednotpublished\n";
exit 0;