From: Don Armstrong Date: Sat, 30 Nov 2013 04:11:08 +0000 (-0800) Subject: merge master X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=4af1d57d3b9c0f59397f3d7283090a6129ca2488 merge master --- diff --git a/Debbugs/Common.pm b/Debbugs/Common.pm index 43c752b..b5842d1 100644 --- a/Debbugs/Common.pm +++ b/Debbugs/Common.pm @@ -464,11 +464,8 @@ sub __add_to_hash { binmode($fh,':encoding(UTF-8)'); while (<$fh>) { chomp; - my @elements = split /\t/; - next unless @elements >=2; - # we do this because the source maintainer file contains the - # archive location, which we don't care about - my ($key,$value)=($elements[0],$elements[-1]); + next unless m/^(\S+)\s+(\S.*\S)\s*$/; + my ($key,$value)=($1,$2); $key = lc $key; $forward->{$key}= $value; if (defined $reverse) { diff --git a/Debbugs/Libravatar.pm b/Debbugs/Libravatar.pm index 99184ec..8dcbad0 100644 --- a/Debbugs/Libravatar.pm +++ b/Debbugs/Libravatar.pm @@ -159,7 +159,7 @@ sub retrieve_libravatar{ $temp_fn, $cache_location.'.'.$dest_type) == 0 or die "convert file failed"; - unlink($temp_fh); + unlink($temp_fn); }; if ($@) { unlink($cache_location.'.'.$dest_type) if -e $cache_location.'.'.$dest_type; diff --git a/Debbugs/MIME.pm b/Debbugs/MIME.pm index 15078f2..f2868a9 100644 --- a/Debbugs/MIME.pm +++ b/Debbugs/MIME.pm @@ -49,8 +49,8 @@ BEGIN { $EXPORT_TAGS{all} = [@EXPORT_OK]; } -use File::Path; -use File::Temp qw(); +use File::Path qw(remove_tree); +use File::Temp qw(tempdir); use MIME::Parser; use POSIX qw(strftime); @@ -94,7 +94,7 @@ sub parse my (@headerlines, @bodylines); my $parser = MIME::Parser->new(); - my $tempdir = File::Temp::tempdir(); + my $tempdir = tempdir(CLEANUP => 1); $parser->output_under($tempdir); my $entity = eval { $parser->parse_data($_[0]) }; @@ -135,7 +135,7 @@ sub parse @bodylines = map {convert_to_utf8($_,$charset)} @msg[$i .. $#msg]; } - rmtree $tempdir, 0, 1; + remove_tree($tempdir,{verbose => 0, safe => 1}); # Remove blank lines. shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;