diff options
author | Tim Retout <tim@retout.co.uk> | 2012-02-17 20:23:18 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-18 09:40:53 +0000 |
commit | bf6e2d4ccf3baadaedc532b9cd8582ac16352bf2 (patch) | |
tree | a795859cb6014c80733a963f7f46815db01a0798 /solenv/bin/modules | |
parent | c866c25f2646f56afa5a7ecf3a35e62bae0cdb7a (diff) |
Remove packager::existence, and clean up packager::work.
Diffstat (limited to 'solenv/bin/modules')
-rw-r--r-- | solenv/bin/modules/packager/existence.pm | 52 | ||||
-rw-r--r-- | solenv/bin/modules/packager/work.pm | 80 |
2 files changed, 17 insertions, 115 deletions
diff --git a/solenv/bin/modules/packager/existence.pm b/solenv/bin/modules/packager/existence.pm deleted file mode 100644 index 81f13395befc..000000000000 --- a/solenv/bin/modules/packager/existence.pm +++ /dev/null @@ -1,52 +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. -# -#************************************************************************* - -package packager::existence; - -############################# -# Test of existence -############################# - -sub exists_in_array -{ - my ($searchstring, $arrayref) = @_; - - my $alreadyexists = 0; - - for ( my $i = 0; $i <= $#{$arrayref}; $i++ ) - { - if ( ${$arrayref}[$i] eq $searchstring) - { - $alreadyexists = 1; - last; - } - } - - return $alreadyexists; -} - -1; diff --git a/solenv/bin/modules/packager/work.pm b/solenv/bin/modules/packager/work.pm index 248183480005..cd5a7fc43f99 100644 --- a/solenv/bin/modules/packager/work.pm +++ b/solenv/bin/modules/packager/work.pm @@ -28,11 +28,12 @@ package packager::work; +use strict; +use warnings; + use base 'Exporter'; use packager::exiter; -use packager::existence; -use packager::files; use packager::globals; our @EXPORT_OK = qw( @@ -54,31 +55,6 @@ sub set_global_variable $packager::globals::compiler = $compiler; } -############################################################################# -# Converting a string list with separator $listseparator -# into an array -############################################################################# - -sub convert_stringlist_into_array -{ - my ( $includestringref, $listseparator ) = @_; - - my @newarray = (); - my $first; - my $last = ${$includestringref}; - - while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching - { - $first = $1; - $last = $2; - push(@newarray, "$first"); - } - - push(@newarray, "$last"); - - return \@newarray; -} - ########################################### # Generating a list of package calls # corresponding to the package list @@ -90,51 +66,29 @@ sub create_package_todos my @targets = (); # only used, if the build server is not used - for ( my $i = 0; $i <= $#{$packagelist}; $i++ ) - { - my $line = ${$packagelist}[$i]; - - if ( $line =~ /^\s*\#/ ) { next; } # comment line - - if ( $line =~ /^\s*(\w+?)\s+(\S+?)\s+(\S+?)\s+(\w+?)\s*$/ ) - { - my $product = $1; - my $compilerlist = $2; - my $languagelist = $3; - my $target = $4; + for my $line ( @{$packagelist} ) { + next if ($line =~ /^\s*\#/); # comment line - $product =~ s/\s//g; - $compilerlist =~ s/\s//g; - $languagelist =~ s/\s//g; - $target =~ s/\s//g; + my ($product, $compilerlist, $languagelist, $target) = + ($line =~ /^\s*(\w+?)\s+(\S+?)\s+(\S+?)\s+(\w+?)\s*$/); - my $compilers = convert_stringlist_into_array(\$compilerlist, ","); + my @compilers = split ',', $compilerlist; - # is the compiler of this "build" part of the compiler list in pack.lst ? + # is the compiler of this "build" part of the compiler list in pack.lst ? - if ( packager::existence::exists_in_array($packager::globals::compiler, $compilers) ) - { - # products are separated in pack.lst by "|" + next unless grep { $_ eq $packager::globals::compiler } @compilers; - my $languagesets = convert_stringlist_into_array(\$languagelist, "\|"); + # products are separated in pack.lst by "|" + # now all information is available to create the targets for the systemcalls + for my $languagestring (split '\|', $languagelist) { + $languagestring =~ s/,/_/g; # comma in pack.lst becomes "_" in dmake command - # now all information is available to create the targets for the systemcalls - - for ( my $j = 0; $j <= $#{$languagesets}; $j++ ) - { - my $languagestring = ${$languagesets}[$j]; - $languagestring =~ s/\,/\_/g; # comma in pack.lst becomes "_" in dmake command - - my $target = $target . "_" . $languagestring; - push(@targets, $target); - - my $insertline = $target . "\n"; - push( @packager::globals::logfileinfo, $insertline); - } - } + push @targets, $target . '_' . $languagestring; } } + push @packager::globals::logfileinfo, map { $_ . "\n" } @targets; + return \@targets; } |