Changeset 1153 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/Log.pm


Ignore:
Timestamp:
Jan 12, 2011, 2:42:12 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Avoid File::MimeInfo hard requirement. Only abort if not found when needed.
  • Improve report when a perl module is missing
  • Kill an existing crashed VM using an SSH port needed for another VM (should avoid crashed VM to stay when building for all VMs)
  • Use a new parameter vmbuildtm as a timeout before killing the VM (shoudl correspond to build + transfer time)
  • use twice the number of VMs for ports in the range for SSH communication to allow for VMs to finish in an unordered way.
  • Fix a bug in test modules when using Test simple only
  • Mail::Sendmail is now optional for Log module as well, even if not used yet
  • Update pb.conf doc with info for vmbuildtm and vmmem
  • Ready for 0.10.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Log.pm

    r1148 r1153  
    227227# mails the summary to $to
    228228sub mailSummary {
    229     require Mail::Sendmail;
    230     my $self = shift;
    231     my $to = shift || "";
    232 
    233     if ($to eq "") {
    234         pb_log(0,"Please give a To: address\n");
    235         return;
    236     }
    237     my %mail = (   
    238         To => $to,
    239         From => "pb\@localhost",
    240         Message => $self->summary()
    241     );
    242     if (! sendmail(%mail)) {
    243         if (defined $Mail::Sendmail::error) {
    244             return $Mail::Sendmail::error;
    245         } else {
    246             return "Unkown error";
    247         }
    248     }
    249     pb_log(0,"Mail send to ". $to ."\n");
     229    eval
     230    {
     231        require Mail::Sendmail;
     232        Mail::Sendmail->import();
     233    };
     234    if ($@) {
     235        # Mail::Sendmail not found not sending mail !
     236        pb_log(0,"No Mail::Sendmail module found so not sending any mail !\n");
     237    } else {
     238        my $self = shift;
     239        my $to = shift || "";
     240
     241        if ($to eq "") {
     242            pb_log(0,"Please give a To: address\n");
     243            return;
     244        }
     245        my %mail = (   
     246            To => $to,
     247            From => "pb\@localhost",
     248            Message => $self->summary()
     249        );
     250        if (! sendmail(%mail)) {
     251            if (defined $Mail::Sendmail::error) {
     252                return $Mail::Sendmail::error;
     253            } else {
     254                return "Unkown error";
     255            }
     256        }
     257        pb_log(0,"Mail send to ". $to ."\n");
     258    }
    250259}
    251260
Note: See TracChangeset for help on using the changeset viewer.