bin/rpi
branchrsync
changeset 37 a31ece02f311
parent 35 ff9bdf95363c
child 42 73cb1d7a1bd8
equal deleted inserted replaced
36:476655f48d19 37:a31ece02f311
     9 
     9 
    10 use IO::File;
    10 use IO::File;
    11 use IPC::Run qw(run);
    11 use IPC::Run qw(run);
    12 use Getopt::Long;
    12 use Getopt::Long;
    13 use Mail::Sendmail;
    13 use Mail::Sendmail;
       
    14 use MIME::EncWords qw(encode_mimewords);
    14 use Pod::Usage;
    15 use Pod::Usage;
       
    16 use POSIX qw(locale_h);
    15 use Sys::Hostname::Long;
    17 use Sys::Hostname::Long;
    16 
    18 
    17 my %opt = ('run-lintian' => 1,);
    19 my %opt = ('run-lintian' => 1,);
    18 
    20 
    19 GetOptions(
    21 GetOptions(
   142 # of the .changes file if present; 'maintainer' will be extracted from the
   144 # of the .changes file if present; 'maintainer' will be extracted from the
   143 # 'Maintainer' field if necessary; nothing will be returned if the signature
   145 # 'Maintainer' field if necessary; nothing will be returned if the signature
   144 # verification command fails for some reason
   146 # verification command fails for some reason
   145 sub uploader($) {
   147 sub uploader($) {
   146     my ($c) = @_;
   148     my ($c) = @_;
   147     my $vc = "LANG=POSIX /usr/bin/gpg --verify $c 2>&1";
   149     my $vc = "LC_MESSAGES=POSIX /usr/bin/gpg --verify $c 2>&1";
   148 
   150 
   149     my @r = qx{$vc};
   151     my @r = qx{$vc};
   150 
   152 
   151     if ($?) {
   153     if ($?) {
   152         warn "[$0]: [$vc] failed: [$!] [$?]\n";
   154         warn "[$0]: [$vc] failed: [$!] [$?]\n";
   384                 "[This is just a test mail to you. If this wasn't a test mail, then it should have been sent to [$u]]\n\n"
   386                 "[This is just a test mail to you. If this wasn't a test mail, then it should have been sent to [$u]]\n\n"
   385                   . $messages->{$u},
   387                   . $messages->{$u},
   386                 $fallback
   388                 $fallback
   387             ) if $dont_send_to_real_uploader;
   389             ) if $dont_send_to_real_uploader;
   388 
   390 
       
   391             $to = encode_mimewords($to, (Charset => $1)) if setlocale(NULL) =~ /.*\.([^.]+)$/;
       
   392 
   389             sendmail(
   393             sendmail(
   390                 From    => $from,
   394                 From    => $from,
   391                 Subject => $subject,
   395                 Subject => $subject,
   392                 To      => $to,
   396                 To      => $to,
   393                 Message => $msg
   397                 Message => $msg