[Libreoffice-commits] core.git: 2 commits - postprocess/packimages solenv/bin

Thomas Arnhold thomas at arnhold.org
Wed Sep 11 20:02:26 PDT 2013


 postprocess/packimages/README          |    2 
 solenv/bin/modules/packager/check.pm   |   79 ------------------
 solenv/bin/modules/packager/exiter.pm  |   62 --------------
 solenv/bin/modules/packager/files.pm   |  143 ---------------------------------
 solenv/bin/modules/packager/globals.pm |   45 ----------
 solenv/bin/modules/packager/work.pm    |  118 ---------------------------
 solenv/bin/modules/t/packager-work.t   |   45 ----------
 solenv/bin/packager.pl                 |   51 -----------
 8 files changed, 1 insertion(+), 544 deletions(-)

New commits:
commit ae4382f7e082b372524be9285eb48058e354f81f
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu Sep 12 04:38:09 2013 +0200

    typo
    
    Change-Id: I92687275c9a8ea1ae063aac5877ad5819bda9a2d

diff --git a/postprocess/packimages/README b/postprocess/packimages/README
index cf7b96e..95d5f3d 100644
--- a/postprocess/packimages/README
+++ b/postprocess/packimages/README
@@ -5,7 +5,7 @@ This script takes several sources of information:
 
 * the list of images used in every .src file that is compiled
 * the configuration XML describing every command that is used
-* [[packimages/pack/iamge-sort.lst]] which provides a profile based
+* [[packimages/pack/image-sort.lst]] which provides a profile based
   ordering of images.
 
 It then tries to pack the images together into the .zip file into an
commit e161e35f55d0ff73d735fa4dbd578c072c1c3d38
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu Sep 12 04:23:00 2013 +0200

    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

diff --git a/solenv/bin/modules/packager/check.pm b/solenv/bin/modules/packager/check.pm
deleted file mode 100644
index 85e274b..0000000
--- 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 cc2e65d..0000000
--- 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 8a947f2..0000000
--- 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 0f6108a..0000000
--- 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 31f3b2f..0000000
--- 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 58fb674..0000000
--- 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';
- at 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();
diff --git a/solenv/bin/packager.pl b/solenv/bin/packager.pl
deleted file mode 100644
index d8ccd00..0000000
--- a/solenv/bin/packager.pl
+++ /dev/null
@@ -1,51 +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 .
-#
-
-use lib ("$ENV{SOLARENV}/bin/modules");
-
-use Cwd;
-use packager::check;
-use packager::files;
-use packager::globals;
-use packager::work;
-
-####################################
-# Main program
-####################################
-
-packager::check::check_environment();
-packager::check::check_packlist();
-packager::check::check_parameter();
-
-packager::work::set_global_variable();
-
-my $packagelist = packager::files::read_file($packager::globals::packlistname);
-
-my $targets = packager::work::create_package_todos($packagelist);
-
-packager::work::execute_system_calls($targets);
-
-if ( $packager::globals::logging )
-{
-    packager::files::save_file($packager::globals::logfilename, \@packager::globals::logfileinfo);
-    print "Log file written: $packager::globals::logfilename\n";
-}
-
-####################################
-# End main program
-####################################


More information about the Libreoffice-commits mailing list