Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


I created a patch that I believe deletes the mail function from
mail_installer.pl and related modules, per the item listed on the Easy
Hacks wiki page.

I ran "make" and "make dev-install" and it works...however, if there's
something else I should run to ensure that the code is functioning
properly, please let me know.

Also, I created the patch from the "solenv/bin" directory, where the
code lies. Should I have created it from the bootstrap directory?

Thanks!

Samuel Cantrell
From b8571e6be489f528b7b3a6c5037f2d4b46a6dc7f Mon Sep 17 00:00:00 2001
From: Samuel Cantrell <samuelcantrell@gmail.com>
Date: Fri, 10 Jun 2011 17:29:32 -0700
Subject: [PATCH] Removes mail function from make_installer.pl

Removed mail module from installer subdirectory. I also removed code
that referenced the functions within this module (such as one
that sent a message if the process failed, one that sent a message
if the process succeeded, etc.)
---
 solenv/bin/make_installer.pl                |    1 -
 solenv/bin/modules/installer/copyproject.pm |    1 -
 solenv/bin/modules/installer/mail.pm        |  136 ---------------------------
 solenv/bin/modules/installer/worker.pm      |    6 +-
 4 files changed, 2 insertions(+), 142 deletions(-)
 delete mode 100644 solenv/bin/modules/installer/mail.pm

diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
index e5734ce..d895cc9 100644
--- a/solenv/bin/make_installer.pl
+++ b/solenv/bin/make_installer.pl
@@ -48,7 +48,6 @@ use installer::helppack;
 use installer::languagepack;
 use installer::languages;
 use installer::logger;
-use installer::mail;
 use installer::packagelist;
 use installer::packagepool;
 use installer::parameter;
diff --git a/solenv/bin/modules/installer/copyproject.pm 
b/solenv/bin/modules/installer/copyproject.pm
index 93f4d29..0a31009 100644
--- a/solenv/bin/modules/installer/copyproject.pm
+++ b/solenv/bin/modules/installer/copyproject.pm
@@ -32,7 +32,6 @@ use installer::converter;
 use installer::files;
 use installer::globals;
 use installer::logger;
-use installer::mail;
 use installer::systemactions;
 use installer::worker;
 
diff --git a/solenv/bin/modules/installer/mail.pm b/solenv/bin/modules/installer/mail.pm
deleted file mode 100644
index f0e3251..0000000
--- a/solenv/bin/modules/installer/mail.pm
+++ /dev/null
@@ -1,136 +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 installer::mail;
-
-use Net::SMTP;
-use installer::converter;
-use installer::exiter;
-use installer::ziplist;
-
-#########################################
-# Sending a mail
-#########################################
-
-sub send_mail
-{
-    my ($message, $listenerstring, $mailinfostring, $languagesref, $destdir) = @_;
-    
-    my $listener = installer::converter::convert_stringlist_into_array($listenerstring, ",");
-    my $mailinfo = installer::converter::convert_stringlist_into_array($mailinfostring, ",");
-
-    my @listener = ();
-
-    for ( my $i = 0; $i <= $#{$listener}; $i++ ) { push(@listener, ${$listener}[$i]); }
-    for ( my $i = 0; $i <= $#{$mailinfo}; $i++ ) { ${$mailinfo}[$i] =~ s/\s*$//g; }
-
-    my $smtphost = ${$mailinfo}[0];
-    my $account = ${$mailinfo}[1];
-    my $sender = ${$mailinfo}[2];
-
-    if ( ! $smtphost ) { installer::exiter::exit_program("ERROR: Could not read SMTP Host in list 
file!", "send_mail"); }
-    if ( ! $account ) { installer::exiter::exit_program("ERROR: Could not read Account in list 
file!", "send_mail"); }
-    if ( ! $sender ) { installer::exiter::exit_program("ERROR: Could not read Sender in list 
file!", "send_mail"); }
-
-    my $subject = "";
-    my $basestring = $installer::globals::product . " " . $installer::globals::compiler . 
$installer::globals::productextension . " " . $installer::globals::build. " " . 
$installer::globals::buildid . " " . $$languagesref . "\n";
-    if ( $message eq "ERROR" ) { $subject = "ERROR: $basestring" }
-    if ( $message eq "SUCCESS" ) { $subject = "SUCCESS: $basestring" }
-
-    my @message = ();
-    
-    my $recipient_string = join ',', @listener;
-    push(@message, "Subject: $subject");
-    push(@message, "To: $recipient_string");
-    push(@message, "\n");
-    push(@message, "Located at $destdir");
-
-    if ( $message eq "ERROR" ) 
-    {
-        for ( my $j = 0; $j <= $#installer::globals::errorlogfileinfo; $j++ )
-        {
-            my $line = $installer::globals::errorlogfileinfo[$j];
-            $line =~ s/\s*$//g;
-            push(@message, $line);
-        }
-    }
-
-    for ( my $i = 0; $i <= $#message; $i++ ) { $message[$i] = $message[$i] . "\015\012"; }
-
-    my $smtp = Net::SMTP->new( $smtphost, Hello => $account, Debug => 0 );
-
-    # set sender
-    $smtp->mail($sender);
-
-    # listener
-    my @good_addresses = ();
-    $smtp->recipient( @listener, { SkipBad => 1 } );
-
-    # send message             
-    $smtp->data(\@message);
-
-    # quit server
-    $smtp->quit();
-}
-
-sub send_fail_mail
-{
-    my ($allsettingsarrayref, $languagestringref, $errordir) = @_;
-
-    # sending a mail into the error board
-    my $listener = "";
-    $listener = installer::ziplist::getinfofromziplist($allsettingsarrayref, "fail");
-    
-    if ( $$listener )
-    { 
-        my $mailinfo = installer::ziplist::getinfofromziplist($allsettingsarrayref, "mailinfo");
-        
-        if ( $$mailinfo ) { send_mail("ERROR", $listener, $mailinfo, $languagestringref, 
$errordir); }
-        else { installer::exiter::exit_program("ERROR: Could not read mailinfo in list file!", 
"send_fail_mail"); }
-    }
-}                      
-
-sub send_success_mail
-{
-    my ($allsettingsarrayref, $languagestringref, $completeshipinstalldir) = @_;
-
-    # sending success mail
-    my $listener = "";
-    $listener = installer::ziplist::getinfofromziplist($allsettingsarrayref, "success");
-
-    if ( $$listener )
-    {
-        my $mailinfo = installer::ziplist::getinfofromziplist($allsettingsarrayref, "mailinfo");
-
-        if ( $$mailinfo ) { send_mail("SUCCESS", $listener, $mailinfo, $languagestringref, 
$completeshipinstalldir); }
-        else { installer::exiter::exit_program("ERROR: Could not read mailinfo in list file!", 
"send_success_mail"); }
-
-    }
-}                      
-
-
-1;
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index 4a0ccf3..43c1791 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -39,7 +39,6 @@ use installer::exiter;
 use installer::files;
 use installer::globals;
 use installer::logger;
-use installer::mail;
 use installer::pathanalyzer;
 use installer::scpzipfiles;
 use installer::scriptitems;
@@ -412,12 +411,12 @@ sub analyze_and_save_logfile
 
     my $contains_error = installer::control::check_logfile(\@installer::globals::logfileinfo);
 
-    # Dependent from the success, the installation directory can be renamed and mails can be send.
+    # Dependent from the success, the installation directory can be renamed.
         
     if ( $contains_error )
     {
         my $errordir = installer::systemactions::rename_string_in_directory($installdir, 
"_inprogress", "_witherror");
-        if ( $installer::globals::updatepack ) { 
installer::mail::send_fail_mail($allsettingsarrayref, $languagestringref, $errordir); }
+        if ( $installer::globals::updatepack ) { }
         # Error output to STDERR
         for ( my $j = 0; $j <= $#installer::globals::errorlogfileinfo; $j++ )
         {
@@ -443,7 +442,6 @@ sub analyze_and_save_logfile
                 if ( $installdir =~ /_packed/ ) { $destdir = 
installer::systemactions::rename_string_in_directory($installdir, "_inprogress", ""); }
                 else { $destdir = 
installer::systemactions::rename_string_in_directory($installdir, "_inprogress", "_packed"); }
             }
-            installer::mail::send_success_mail($allsettingsarrayref, $languagestringref, $destdir);
         }
         else
         {
-- 
1.7.5.2


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.