[Libreoffice-commits] .: 3 commits - postprocess/checkdeliver postprocess/prj solenv/gbuild

Bjoern Michaelsen bmichaelsen at kemper.freedesktop.org
Fri Oct 21 02:55:25 PDT 2011


 postprocess/checkdeliver/checkdeliver.pl  |  306 ------------------------------
 postprocess/checkdeliver/makefile.mk      |   44 ----
 postprocess/prj/build.lst                 |    1 
 solenv/gbuild/extensions/post_Counters.mk |   41 ++++
 solenv/gbuild/extensions/pre_Counters.mk  |   53 +++++
 solenv/gbuild/gbuild.mk                   |    2 
 6 files changed, 96 insertions(+), 351 deletions(-)

New commits:
commit 8ee4e99a78a7a7f16bafa56e08ef9649cc69dbdb
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Oct 21 11:51:39 2011 +0200

    some more work on the make countoutdated target

diff --git a/solenv/gbuild/extensions/post_Counters.mk b/solenv/gbuild/extensions/post_Counters.mk
index 3552351..c0efdcc 100644
--- a/solenv/gbuild/extensions/post_Counters.mk
+++ b/solenv/gbuild/extensions/post_Counters.mk
@@ -29,6 +29,13 @@ ifneq ($(filter countoutdated,$(MAKECMDGOALS)),)
 
 gb_SrsTarget_add_template=
 gb_SrsTarget_add_templates=
+gb_Output_announce=
+
+ifneq ($(strip $(filter-out countoutdated,$(MAKECMDGOALS))),)
+countoutdated: $(filter-out countoutdated,$(MAKECMDGOALS))
+else
+countoutdated: $(.DEFAULT_GOAL)
+endif
 
 endif
 # vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/pre_Counters.mk b/solenv/gbuild/extensions/pre_Counters.mk
index b0563d0..feebe8c 100644
--- a/solenv/gbuild/extensions/pre_Counters.mk
+++ b/solenv/gbuild/extensions/pre_Counters.mk
@@ -25,23 +25,28 @@
 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
 # instead of those above.
 
-gb_CountersOutdated_COUNTER:=
+gb_CountersOutdated_COUNTER_ALL:=
+gb_CountersOutdated_COUNTER_TYPES:=
 
 .PHONY: countoutdated
-countoutdated: $(filter-out countoutdated,$(MAKECMDGOALS))
-	$(info total outdated files: $(words $(gb_CountersOutdated_COUNTER)))
+countoutdated:
+	$(info total outdated files: $(words $(gb_CountersOutdated_COUNTER_ALL)))
+	$(info types of outdated files: $(gb_CountersOutdated_TYPES))
+	$(foreach type,$(gb_CountersOutdated_TYPES),$(info $(type): $(words $(gb_CountersOutdated_COUNTER_$(type)))))
 	@true
 
 ifneq ($(filter countoutdated,$(MAKECMDGOALS)),)
 
+gb_CHECKOBJECTOWNER := $(false)
+
 $(WORKDIR)/%:
-	$(info $* is outdated.)
-	$(eval gb_CountersOutdated_COUNTER+= x)
+	$(eval gb_CountersOutdated_COUNTER_ALL+= x)
+	$(eval gb_CountersOutdated__TYPE=$(firstword $(subst /, ,$*)))
+	$(if $(filter undefined,$(origin gb_CountersOutdated_COUNTER_$(gb_CountersOutdated__TYPE))),$(eval gb_CountersOutdated_COUNTER_$(gb_CountersOutdated__TYPE):=) $(eval gb_CountersOutdated_TYPES+=$(gb_CountersOutdated__TYPE)))
+	$(eval gb_CountersOutdated_COUNTER_$(gb_CountersOutdated__TYPE)+= x)
 	@true
 	
 $(OUTDIR)/%:
-	$(info $* is outdated (OUTDIR).)
-	$(eval gb_CountersOutdated_COUNTER+= x)
 	@true
 
 endif
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index c91b99f..22b9216 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -126,7 +126,9 @@ else
 gb_FULLDEPS := $(true)
 endif
 
+ifeq ($(origin gb_CHECKOBJECTOWNER),undefined)
 gb_CHECKOBJECTOWNER := $(true)
+endif
 
 # save user-supplied flags for latter use
 ifneq ($(strip $(CFLAGS)),)
commit 39f3d87152f963510ac71d2f0b346188b9965c2f
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Fri Oct 21 00:14:43 2011 +0200

    remove checkdeliver -- we do not generate deliverlogs anyway

diff --git a/postprocess/checkdeliver/checkdeliver.pl b/postprocess/checkdeliver/checkdeliver.pl
deleted file mode 100644
index e6a1e19..0000000
--- a/postprocess/checkdeliver/checkdeliver.pl
+++ /dev/null
@@ -1,306 +0,0 @@
-:
-eval 'exec perl -wS $0 ${1+"$@"}'
-    if 0;
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-#
-#
-# checkdeliver.pl - compare delivered files on solver with those on SRC_ROOT
-#
-
-use strict;
-use Getopt::Long;
-use File::stat;
-use IO::Handle;
-
-use lib ("$ENV{SOLARENV}/bin/modules");
-
-#### globals #####
-
-my $err              = 0;
-my $srcrootdir       = '';
-my $solverdir        = '';
-my $platform         = '';
-my $logfile          = '';
-my $milestoneext     = '';
-my $local_env        = 0;
-my @exceptionmodlist = (
-                        "postprocess",
-                        "instset.*native",
-                        "smoketest.*native",
-                        "testautomation",
-                        "testgraphical"
-                       ); # modules not yet delivered
-
-#### main #####
-
-print_logged("checkdeliver.pl - checking delivered binaries\n");
-
-get_globals();                                  # get global variables
-my $deliverlists_ref = get_deliver_lists();     # get deliver log files
-foreach my $listfile ( @$deliverlists_ref ) {
-    $err += check( $listfile );                 # check delivered files
-}
-print_logged("OK\n") if ( ! $err );
-exit $err;
-
-#### subroutines ####
-
-sub get_globals
-# set global variables using environment variables and command line options
-{
-    my $help;
-
-    # set global variables according to environnment
-    $platform      = $ENV{INPATH};
-    $srcrootdir    = "$ENV{SRC_ROOT}/clone";
-    $solverdir     = $ENV{SOLARVERSION};
-    $milestoneext  = $ENV{UPDMINOREXT};
-
-    # override environment with command line options
-    GetOptions('help' => \$help,
-               'l=s'  => \$logfile,
-               'p=s'  => \$platform
-    ) or usage (1);
-
-    if ( $help ) {
-        usage(0);
-    }
-
-    #do some sanity checks
-    if ( ! ( $platform && $srcrootdir && $solverdir ) ) {
-        die "Error: please set environment\n";
-    }
-    if ( ! -d $solverdir ) {
-        die "Error: cannot find solver directory '$solverdir'\n";
-    }
-
-    # Check for local env., taken from solenv/bin/modules/installer/control.pm
-    # In this case the content of SOLARENV starts with the content of SOL_TMP
-    my $solarenv = "";
-    my $sol_tmp;
-    if ( $ENV{'SOLARENV'} ) {
-        $solarenv = $ENV{'SOLARENV'};
-    }
-    if ( $ENV{'SOL_TMP'} ) {
-        $sol_tmp = $ENV{'SOL_TMP'};
-    }
-    if ( defined $sol_tmp && ( $solarenv =~ /^\s*\Q$sol_tmp\E/ )) {
-        # Content of SOLARENV starts with the content of SOL_TMP: Local environment
-        $local_env = 1;
-    }
-}
-
-sub get_deliver_lists
-# find deliver log files on solver
-{
-    my @files;
-    my $pattern = "$solverdir/$platform/inc";
-    $pattern .= "$milestoneext" if ( $milestoneext );
-    $pattern .= "/*/deliver.log";
-
-    @files = glob( $pattern );
-    # do not check modules not yet built
-    foreach my $exceptionpattern ( @exceptionmodlist ) {
-        @files = grep ! /\/$exceptionpattern\//, @files;
-    }
-    if ( ! @files ) {
-        print_logged( "Error: cannot find deliver log files\n" );
-        exit 1;
-    }
-    return \@files;
-}
-
-sub check
-# reads deliver log file given as parameter and compares pairs of files listed there.
-{
-    my $listname = shift;
-    my $error = 0;
-    my %delivered;
-    my $module;
-    my $repository;
-    STDOUT->autoflush(1);
-    # which module are we checking?
-    if ( $listname =~ /\/([\w-]+?)\/deliver\.log$/o) {
-        $module = $1;
-    } else {
-        print_logged( "Error: cannot determine module name from \'$listname\'\n" );
-        return 1;
-    }
-
-    if ( -z $listname ) {
-        print_logged( "Warning: empty deliver log file \'$listname\'. Module '$module' not delivered correctly?\n\n" );
-        return 0;
-    }
-
-    # read deliver log file
-    if ( ! open( DELIVERLOG, "< $listname" ) ) {
-        print_logged( "Error: cannot open file \'$listname\'\n$!" );
-        exit 2;
-    }
-    while ( <DELIVERLOG> ) {
-        next if ( /^LINK / );
-        # What's this modules' repository?
-        if ( /COPY\s+(.+?)\/$module\/prj\/build.lst/ ) {
-#        if ( /COPY (\w[\w\s-]*?)\/$module\/prj\/build.lst/ ) {
-            $repository = $1;
-        }
-        # For now we concentrate on binaries, located in 'bin' or 'lib' and 'misc/build/<...>/[bin|lib]'.
-        next if ( (! /\/$module\/$platform\/[bl]i[nb]\//) && (! /\/$module\/$platform\/misc\/build\//));
-        next if (! /[bl]i[nb]/);
-        next if ( /\.html$/ );
-        chomp;
-        if ( /^\w+? (\S+) (\S+)\s*$/o ) {
-            my $origin = $1;
-            $delivered{$origin} = $2;
-        } else {
-            print_logged( "Warning: cannot parse \'$listname\' line\n\'$_\'\n" );
-        }
-    }
-    close( DELIVERLOG );
-
-    if ( ! $repository ) {
-        print_logged( "Error parsing \'$listname\': cannot determine repository. Module '$module' not delivered correctly?\n\n" );
-        $error ++;
-        return $error;
-    }
-
-    my $path = "$srcrootdir/$repository/$module";
-    # is module physically accessible?
-    # there are valid use cases where we build against a prebuild solver whithout having
-    # all modules at disk
-    my $canread = is_moduledirectory( $path );
-    if ( ! $canread ) {
-        # do not bother about non existing modules in local environment
-        if ( $local_env ) {
-            return $error;
-        }
-        # in a master build it is considered an error to have deliver leftovers
-        # from non exising (removed) modules
-        print_logged( "Error: module '$module' not found.\n" );
-        $error++;
-        return $error;
-    }
-    if ( $canread == 2 ) {
-        # module is linked and not built, no need for checking
-        # should not happen any more nowadays ...
-        return $error;
-    }
-
-    # compare all delivered files with their origin
-    # no strict 'diff' allowed here, as deliver may alter files (hedabu, strip, ...)
-    foreach my $file ( sort keys %delivered ) {
-        my $ofile = "$srcrootdir/$file";
-        my $sfile = "$solverdir/$delivered{$file}";
-        if ( $milestoneext ) {
-            # deliver log files do not contain milestone extension on solver
-            $sfile =~ s/\/$platform\/(...)\//\/$platform\/$1$milestoneext\//;
-        }
-        my $orgfile_stats = stat($ofile);
-        next if ( -d _ );  # compare files, not directories
-        my $delivered_stats = lstat($sfile);
-        next if ( -d _ );  # compare files, not directories
-        if ( $^O !~ /^MSWin/ ) {
-            # windows does not know about links.
-            # Therefore lstat() is not a lstat, and the following check would break
-            next if ( -l _ );  # compare files, not links
-        }
-
-        if ( $orgfile_stats && $delivered_stats ) {
-            # Stripping (on unix like platforms) and signing (for windows)
-            # changes file size. Therefore we have to compare for file dates.
-            # File modification time also can change after deliver, f.e. by
-            # rebasing, but only increase. It must not happen that a file on
-            # solver is older than it's source.
-            if ( ( $orgfile_stats->mtime - $delivered_stats->mtime ) gt 1 ) {
-                print_logged( "Error: " );
-                print_logged( "delivered file is older than it's source '$ofile' '$sfile'\n" );
-                $error ++;
-            }
-        } elsif ( !$orgfile_stats && $delivered_stats ) {
-            # This is not an error if we have a solver and did not build the
-            # module!
-        } elsif ( !$orgfile_stats && !$delivered_stats ) {
-            # This is not necessarily an error.
-            # Instead, this seems to be an error of the deliver.log file.
-        } else {
-            print_logged( "Error: no such file '$ofile'\n" ) if ( ! $orgfile_stats );
-            print_logged( "Error: no such file '$sfile'\n" ) if ( ! $delivered_stats );
-            $error ++;
-        }
-    }
-    if ( $error ) {
-        print_logged( "$error errors found: Module '$module' not delivered correctly?\n\n" );
-    }
-    STDOUT->autoflush(0);
-    return $error;
-}
-
-sub is_moduledirectory
-# Test whether we find a module having a d.lst file at a given path.
-# Return value: 1: path is valid directory
-#               2: path.link is a valid link
-#               0: module not found
-{
-    my $dirname = shift;
-    if ( -e "$dirname/prj/d.lst" ) {
-        return 1;
-    } elsif ( -e "$dirname.link/prj/d.lst" ) {
-        return 2
-    } else {
-        return 0;
-    }
-}
-
-sub print_logged
-# Print routine.
-# If a log file name is specified with '-l' option, print_logged() prints to that file
-# as well as to STDOUT. If '-l' option is not set, print_logged() just writes to STDOUT
-{
-    my $message = shift;
-    print "$message";
-    if ( $logfile ) {
-        open ( LOGFILE, ">> $logfile" ) or die "Can't open logfile '$logfile'\n";
-        print LOGFILE "$message";
-        close ( LOGFILE) ;
-    }
-}
-
-
-sub usage
-# print usage message and exit
-{
-    my $retval = shift;
-    print STDERR "Usage: checkdeliver.pl [-h] [-p <platform>]\n";
-    print STDERR "Compares delivered files on solver with original ones in build tree\n";
-    print STDERR "Options:\n";
-    print STDERR "    -h              print this usage message\n";
-    print STDERR "    -p platform     specify platform\n";
-
-    exit $retval;
-}
-
diff --git a/postprocess/checkdeliver/makefile.mk b/postprocess/checkdeliver/makefile.mk
deleted file mode 100644
index ad6f5c0..0000000
--- a/postprocess/checkdeliver/makefile.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-
-
-PRJNAME=postprocess
-TARGET=checkdeliver
-
-.INCLUDE : settings.mk
-
-.INCLUDE : target.mk
-
-ALLTAR : $(MISC)$/checkdeliver.done
-
-$(MISC)$/checkdeliver.done .PHONY:
-    # FIXME: the output was always ignored until ooo320-m15; it would be nice to check it though
-    # $(PERL) checkdeliver.pl && $(TOUCH) $@
-    $(TOUCH) $@
-
diff --git a/postprocess/prj/build.lst b/postprocess/prj/build.lst
index d170851..eb6513d 100644
--- a/postprocess/prj/build.lst
+++ b/postprocess/prj/build.lst
@@ -1,7 +1,6 @@
 po      postprocess     ::      accessibility BINFILTER:binfilter configmgr CRASHREP:crashrep CT2N:ct2n dtrans embeddedobj embedserv EPM:epm DESKTOP:extensions extras fpicker HELP:helpcontent2 io LIBRSVG:librsvg lingucomponent ODK:odk officecfg psprint_config remotebridges scaddins scp2 DESKTOP:setup_native sysui testtools ucb UnoControls ure wizards MORE_FONTS:more_fonts DICTIONARIES:dictionaries PYUNO:pyuno readlicense_oo DESKTOP:unodevtools JFREEREPORT:jfreereport REPORTBUILDER:reportbuilder LANGUAGETOOL:languagetool SDEXT:sdext MYSQLC:mysqlc NLPSOLVER:nlpsolver STLPORT:stlport LIBXSLT:libxslt tail_build NULL
 po	postprocess			    	usr1	-	all	po_mkout NULL
 po	postprocess\checkxml		nmake	-	all	po_checkxml NULL
-po	postprocess\checkdeliver	nmake	-	all	po_checkdlv NULL
 po	postprocess\packconfig		nmake	-	all	po_packconfig po_checkxml NULL
 po      postprocess\packregistry        nmake   -       all     po_packregistry NULL
 po      postprocess\packcomponents      nmake   -       all     po_packcomponents NULL
commit 05a33692a084f59f2fae0a535131133d2a3f6b72
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Thu Oct 20 23:19:46 2011 +0200

    experimental countoutdated target

diff --git a/solenv/gbuild/extensions/post_Counters.mk b/solenv/gbuild/extensions/post_Counters.mk
new file mode 100644
index 0000000..3552351
--- /dev/null
+++ b/solenv/gbuild/extensions/post_Counters.mk
@@ -0,0 +1,34 @@
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+#       Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen at canonical.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+ifneq ($(filter countoutdated,$(MAKECMDGOALS)),)
+
+gb_SrsTarget_add_template=
+gb_SrsTarget_add_templates=
+
+endif
+# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/pre_Counters.mk b/solenv/gbuild/extensions/pre_Counters.mk
new file mode 100644
index 0000000..b0563d0
--- /dev/null
+++ b/solenv/gbuild/extensions/pre_Counters.mk
@@ -0,0 +1,48 @@
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+#       Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen at canonical.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+gb_CountersOutdated_COUNTER:=
+
+.PHONY: countoutdated
+countoutdated: $(filter-out countoutdated,$(MAKECMDGOALS))
+	$(info total outdated files: $(words $(gb_CountersOutdated_COUNTER)))
+	@true
+
+ifneq ($(filter countoutdated,$(MAKECMDGOALS)),)
+
+$(WORKDIR)/%:
+	$(info $* is outdated.)
+	$(eval gb_CountersOutdated_COUNTER+= x)
+	@true
+	
+$(OUTDIR)/%:
+	$(info $* is outdated (OUTDIR).)
+	$(eval gb_CountersOutdated_COUNTER+= x)
+	@true
+
+endif
+# vim: set noet ts=4 sw=4:


More information about the Libreoffice-commits mailing list