solenv/bin/modules/installer/helppack.pm | 5 +- solenv/bin/modules/installer/packagelist.pm | 2 solenv/bin/modules/t/installer-packagelist.t | 57 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-)
New commits: commit d3374e77c3df1f928fe90c4c3803938f08a250b2 Author: Tim Retout <tim.ret...@smoothwall.net> Date: Wed Mar 14 22:17:27 2012 +0000 Turn on strictures and warnings in installer::helppack. diff --git a/solenv/bin/modules/installer/helppack.pm b/solenv/bin/modules/installer/helppack.pm index 977b0ba..a6a9627 100644 --- a/solenv/bin/modules/installer/helppack.pm +++ b/solenv/bin/modules/installer/helppack.pm @@ -27,6 +27,9 @@ package installer::helppack; +use strict; +use warnings; + use installer::converter; use installer::files; use installer::globals; @@ -136,7 +139,7 @@ sub create_tar_gz_file $packagename =~ s/\.rpm\s*$//; my $targzname = $packagename . ".tar.gz"; - $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname"; + my $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname"; installer::logger::print_message( "... $systemcall ...\n" ); my $returnvalue = system($systemcall); commit 712e7b813825ec9fb1d0c1fcdbfcea2f44274e69 Author: Tim Retout <t...@retout.co.uk> Date: Thu Feb 23 20:11:50 2012 +0000 Unit test and correction for remove_multiple_modules_packages diff --git a/solenv/bin/modules/installer/packagelist.pm b/solenv/bin/modules/installer/packagelist.pm index d6b2f02..e39917c 100644 --- a/solenv/bin/modules/installer/packagelist.pm +++ b/solenv/bin/modules/installer/packagelist.pm @@ -214,7 +214,7 @@ sub remove_multiple_modules_packages # modules will only be removed from packages, that have more modules # than the compare package - if ( $packagecount <= $comparepackagecount ) { next; } # nothing to do, take next package + if ( $packagecount < $comparepackagecount ) { next; } # nothing to do, take next package # iterating over all modules of this package diff --git a/solenv/bin/modules/t/installer-packagelist.t b/solenv/bin/modules/t/installer-packagelist.t new file mode 100644 index 0000000..b4ef6ce --- /dev/null +++ b/solenv/bin/modules/t/installer-packagelist.t @@ -0,0 +1,57 @@ +# 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. +# +# Major Contributor(s): +# [ Copyright (C) 2012 Tim Retout <t...@retout.co.uk> (initial developer) ] +# +# All Rights Reserved. +# +# 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. + +use strict; +use warnings; + +use lib '.'; + +use Test::More; + +BEGIN { + use_ok('installer::packagelist'); +} + +my @packagemodules = ( + { allmodules => [qw(a b c d)] }, + { allmodules => [qw(a b c)] }, + { allmodules => [qw(e f g)] }, + { allmodules => [qw(h)] }, + { allmodules => [qw(a b g)] }, +); + +my @expected_packagemodules = ( + { allmodules => [qw(d)] }, + { allmodules => [qw(c)] }, + { allmodules => [qw(e f)] }, + { allmodules => [qw(h)] }, + { allmodules => [qw(a b g)] }, +); + +installer::packagelist::remove_multiple_modules_packages(\@packagemodules); + +is_deeply(\@packagemodules, \@expected_packagemodules); + +done_testing(); _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits