diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-09-12 04:23:00 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-09-12 05:01:27 +0200 |
commit | e161e35f55d0ff73d735fa4dbd578c072c1c3d38 (patch) | |
tree | 82b15379802c834a6f6cb12f819f0a213abbe67f /solenv/bin/modules | |
parent | 1737ee0430b88ff6e95f8bdaa6ef1dcec719ab1d (diff) |
installer: Remove packager.pl
This script seems obsolete since:
1d84e9d1d363bd550129efcbeafe670c0a049dd0
updatepack:
$(PERL) -w $(SOLARENV)$/bin$/packager.pl
Found it because it calls dmake.
Change-Id: I9cb1c194ed56d1fc8125ae5848190854dfe4d86e
Diffstat (limited to 'solenv/bin/modules')
-rw-r--r-- | solenv/bin/modules/packager/check.pm | 79 | ||||
-rw-r--r-- | solenv/bin/modules/packager/exiter.pm | 62 | ||||
-rw-r--r-- | solenv/bin/modules/packager/files.pm | 143 | ||||
-rw-r--r-- | solenv/bin/modules/packager/globals.pm | 45 | ||||
-rw-r--r-- | solenv/bin/modules/packager/work.pm | 118 | ||||
-rw-r--r-- | solenv/bin/modules/t/packager-work.t | 45 |
6 files changed, 0 insertions, 492 deletions
diff --git a/solenv/bin/modules/packager/check.pm b/solenv/bin/modules/packager/check.pm deleted file mode 100644 index 85e274b92914..000000000000 --- a/solenv/bin/modules/packager/check.pm +++ /dev/null @@ -1,79 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -package packager::check; - -use packager::exiter; -use packager::globals; - -############################################## -# Check 1: The package list has to exist -############################################## - -sub check_packlist -{ - my $projectdir = $ENV{'PRJ'}; - $projectdir =~ s/$packager::globals::separator\s*$//; - $packager::globals::packlistname = $projectdir . $packager::globals::separator . "util" . $packager::globals::separator . $packager::globals::packlistname; - - if ( ! -f $packager::globals::packlistname ) - { - packager::exiter::exit_program("ERROR: Package list not found: $packager::globals::packlistname", "check_packlist"); - } -} - -############################################################# -# Check 2: The environment variable OUTPATH has to be set -############################################################# - -sub check_environment -{ - if ( ! $ENV{'OUTPATH'} ) - { - packager::exiter::exit_program("ERROR: Environment variable OUTPATH not set!", "check_environment"); - } - - if ( ! $ENV{'PRJ'} ) - { - packager::exiter::exit_program("ERROR: Environment variable PRJ not set!", "check_environment"); - } -} - -############################################################# -# Check 3: Checking the parameter. Only "-i" is valid -############################################################# - -sub check_parameter -{ - while ( $#ARGV >= 0 ) - { - my $param = shift(@ARGV); - - if ($param eq "-i") { $packager::globals::ignoreerrors = 1; } - else - { - print("\n*************************************\n"); - print("Sorry, unknown parameter: $param"); - print("\n*************************************\n"); - usage(); - exit(-1); - } - } -} - -1; diff --git a/solenv/bin/modules/packager/exiter.pm b/solenv/bin/modules/packager/exiter.pm deleted file mode 100644 index cc2e65d2814f..000000000000 --- a/solenv/bin/modules/packager/exiter.pm +++ /dev/null @@ -1,62 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - - -package packager::exiter; - -use packager::files; -use packager::globals; - -############################################ -# Exiting the program with an error -# This function is used instead of "die" -############################################ - -sub exit_program -{ - my ($message, $function) = @_; - - my $infoline; - - $infoline = "\n***************************************************************\n"; - push(@packager::globals::logfileinfo, $infoline); - print("$infoline"); - - $infoline = "$message\n"; - push(@packager::globals::logfileinfo, $infoline); - print("$infoline"); - - $infoline = "in function: $function\n"; - push(@packager::globals::logfileinfo, $infoline); - print("$infoline"); - - $infoline = "***************************************************************\n"; - push(@packager::globals::logfileinfo, $infoline); - - if ( $packager::globals::logging ) - { - packager::files::save_file($packager::globals::logfilename ,\@packager::globals::logfileinfo); - print("Saved logfile: $packager::globals::logfilename\n"); - } - - print("$infoline"); - - exit(-1); -} - -1; diff --git a/solenv/bin/modules/packager/files.pm b/solenv/bin/modules/packager/files.pm deleted file mode 100644 index 8a947f28f4c6..000000000000 --- a/solenv/bin/modules/packager/files.pm +++ /dev/null @@ -1,143 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - - -package packager::files; - -use packager::exiter; - -############################################ -# File Operations -############################################ - -sub check_file -{ - my ($arg) = @_; - - if(!( -f $arg )) - { - packager::exiter::exit_program("ERROR: Cannot find file $arg", "check_file"); - } -} - -sub read_file -{ - my ($localfile) = @_; - - if ( ! open( IN, $localfile ) ) { - # try again - sometimes we get errors caused by race conditions in parallel builds - sleep 5; - open( IN, $localfile ) or packager::exiter::exit_program("ERROR: Cannot open file: $localfile", "read_file"); - } - my @localfile = <IN>; - close( IN ); - - return \@localfile; -} - -########################################### -# Saving files -########################################### - -sub save_file -{ - my ($savefile, $savecontent) = @_; - open( OUT, ">$savefile" ); - print OUT @{$savecontent}; - close( OUT); - if (! -f $savefile) { packager::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); } -} - -###################################################### -# Creating a new direcotory -###################################################### - -sub create_directory -{ - my ($directory) = @_; - - my $returnvalue = 1; - - if (!(-d $directory)) - { - $returnvalue = mkdir($directory, 0775); - - if ($returnvalue) - { - $infoline = "\nCreated directory: $directory\n"; - push(@packager::globals::logfileinfo, $infoline); - - if ($packager::globals::isunix) - { - my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1"; - system($localcall); - } - } - else - { - packager::exiter::exit_program("ERROR: Could not create directory: $directory", "create_directory"); - } - } -} - -###################################################### -# Removing a complete directory with subdirectories -###################################################### - -sub remove_complete_directory -{ - my ($directory) = @_; - - my @content = (); - - $directory =~ s/\Q$packager::globals::separator\E\s*$//; - - if ( -d $directory ) - { - opendir(DIR, $directory); - @content = readdir(DIR); - closedir(DIR); - - my $oneitem; - - foreach $oneitem (@content) - { - if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) - { - my $item = $directory . $packager::globals::separator . $oneitem; - - if ( -f $item ) # deleting files - { - unlink($item); - } - - if ( -d $item ) # recursive - { - remove_complete_directory($item, 0); - } - } - } - - # try to remove empty directory - - rmdir $directory; - - } -} - -1; diff --git a/solenv/bin/modules/packager/globals.pm b/solenv/bin/modules/packager/globals.pm deleted file mode 100644 index 0f6108aa4a35..000000000000 --- a/solenv/bin/modules/packager/globals.pm +++ /dev/null @@ -1,45 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -package packager::globals; - -############################################ -# Global settings -############################################ - -BEGIN -{ - $prog="packager"; - - $packlistname = "pack.lst"; - $compiler = ""; - $ignoreerrors = 0; - - $logging = 0; - $logfilename = "packager_logfile.log"; # the default logfile name for global errors - @logfileinfo = (); - - $plat = $^O; - - $separator = "/"; - $iswin = 0; - $isunix = 1; - -} - -1; diff --git a/solenv/bin/modules/packager/work.pm b/solenv/bin/modules/packager/work.pm deleted file mode 100644 index 31f3b2f309d9..000000000000 --- a/solenv/bin/modules/packager/work.pm +++ /dev/null @@ -1,118 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - - -package packager::work; - -use strict; -use warnings; - -use base 'Exporter'; - -use packager::exiter; -use packager::globals; - -our @EXPORT_OK = qw( - set_global_variable - create_package_todos - execute_system_calls -); - -########################################### -# Setting global variables -########################################### - -sub set_global_variable -{ - my $compiler = $ENV{'OUTPATH'}; - - if ( $ENV{'PROEXT'} ) { $compiler = $compiler . $ENV{'PROEXT'}; } - - $packager::globals::compiler = $compiler; -} - -########################################### -# Generating a list of package calls -# corresponding to the package list -########################################### - -sub create_package_todos -{ - my ( $packagelist ) = @_; - - my @targets = (); # only used, if the build server is not used - - for my $line ( @{$packagelist} ) { - next if ($line =~ /^\s*\#/); # comment line - - my ($product, $compilerlist, $languagelist, $target) = - ($line =~ /^\s*(\w+?)\s+(\S+?)\s+(\S+?)\s+(\w+?)\s*$/); - - my @compilers = split ',', $compilerlist; - - # is the compiler of this "build" part of the compiler list in pack.lst ? - - next unless grep { $_ eq $packager::globals::compiler } @compilers; - - # 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 - - push @targets, $target . '_' . $languagestring; - } - } - - push @packager::globals::logfileinfo, map { $_ . "\n" } @targets; - - return \@targets; -} - -########################################### -# Executing the generated system calls -########################################### - -sub execute_system_calls -{ - my ( $targets ) = @_; - - for ( my $i = 0; $i <= $#{$targets}; $i++ ) - { - my $systemcall = "dmake " . ${$targets}[$i]; - - my $infoline = "Packager: $systemcall\n"; - print $infoline; - push( @packager::globals::logfileinfo, $infoline); - - my $returnvalue = system($systemcall); - - $infoline = "Packager finished: $systemcall\n"; - print $infoline; - push( @packager::globals::logfileinfo, $infoline); - - if ( $returnvalue ) - { - $infoline = "\nERROR: Packager $systemcall\n"; - print $infoline; - push( @packager::globals::logfileinfo, $infoline); - if (!($packager::globals::ignoreerrors)) { packager::exiter::exit_program("ERROR: Packing not successful : $systemcall", "execute_system_calls"); } - } - } -} - -1; diff --git a/solenv/bin/modules/t/packager-work.t b/solenv/bin/modules/t/packager-work.t deleted file mode 100644 index 58fb674f950e..000000000000 --- a/solenv/bin/modules/t/packager-work.t +++ /dev/null @@ -1,45 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -use strict; -use warnings; - -use Test::More; - -use lib '.'; - -BEGIN { - use_ok('packager::work', qw( - set_global_variable - create_package_todos - execute_system_calls - )); -} - -$packager::globals::compiler = 'gcc'; -@packager::globals::logfileinfo = (); - -my $packagelist = <<'END'; - # Comment - some_product gcc,gcc3.3 en_US,en_GB|fr_FR some_target - other_thing x y z -END - -my @packagelist = split "\n", $packagelist; - -my $targets = create_package_todos( \@packagelist ); - -is_deeply(\@packager::globals::logfileinfo, - ["some_target_en_US_en_GB\n", - "some_target_fr_FR\n"]); - -is_deeply($targets, - ["some_target_en_US_en_GB", - "some_target_fr_FR"]); - -done_testing(); |