[67325] trunk/dports/perl/p5-mime-tools

ricci at macports.org ricci at macports.org
Wed May 5 11:26:18 PDT 2010


Revision: 67325
          http://trac.macports.org/changeset/67325
Author:   ricci at macports.org
Date:     2010-05-05 11:26:15 -0700 (Wed, 05 May 2010)
Log Message:
-----------
p5-mime-tools:  uprev to 5.428, add a variant that allows parsing of MIME messages that are missing their trailing MIME boundaries.

Modified Paths:
--------------
    trunk/dports/perl/p5-mime-tools/Portfile

Added Paths:
-----------
    trunk/dports/perl/p5-mime-tools/files/patch-lib-MIME-Parser.pm.allow_no_trailing_boundary.diff

Modified: trunk/dports/perl/p5-mime-tools/Portfile
===================================================================
--- trunk/dports/perl/p5-mime-tools/Portfile	2010-05-05 16:47:56 UTC (rev 67324)
+++ trunk/dports/perl/p5-mime-tools/Portfile	2010-05-05 18:26:15 UTC (rev 67325)
@@ -3,8 +3,8 @@
 PortSystem		1.0
 PortGroup		perl5 1.0
 
-perl5.setup		MIME-tools 5.425
-revision        1
+perl5.setup		MIME-tools 5.428
+revision        0
 
 maintainers		ricci openmaintainer
 description		modules for parsing (and creating!) MIME entities
@@ -13,14 +13,17 @@
 					multipart (even nested multipart) MIME messages. \
 					(Yes, kids, that means you can send messages with \
 					attached GIF files).
-checksums		md5 35821ae976e2884f4350dc25d4734655
+checksums           md5     dc9bef4af5ca86b729f5277fa52879f4 \
+                    sha1    f7fd3daf1b3a792d4b62414d9c2fbd40f2b62d70 \
+                    rmd160  64e6397bffa9172c00736b150ad088b92bc5f7e7
 platforms		darwin
 
 patchfiles		patch-lib-MIME-Parser.pm.nobinhex.diff \
 				patch-lib-MIME-Parser.pm.useContentTypeName.diff \
-				patch-lib-MIME-Parser.pm.uu_whine.diff	\
-				patch-lib-MIME-Tools.pm.diff
+				patch-lib-MIME-Parser.pm.uu_whine.diff
 
+##				patch-lib-MIME-Tools.pm.diff
+
 depends_lib-append	port:p5-io-stringy	\
 					port:p5-mailtools	\
 					port:p5-file-temp
@@ -34,3 +37,7 @@
 variant doBinHex description {use the (buggy) internal binhex decoder} {
 	patchfiles-delete patch-lib-MIME-Parser.pm.nobinhex.diff
 }
+
+variant allow_no_trailing_boundary description {parse MIME messages without a trailing boundary rather than consider them to be an error} {
+	patchfiles-append patch-lib-MIME-Parser.pm.allow_no_trailing_boundary.diff
+}

Added: trunk/dports/perl/p5-mime-tools/files/patch-lib-MIME-Parser.pm.allow_no_trailing_boundary.diff
===================================================================
--- trunk/dports/perl/p5-mime-tools/files/patch-lib-MIME-Parser.pm.allow_no_trailing_boundary.diff	                        (rev 0)
+++ trunk/dports/perl/p5-mime-tools/files/patch-lib-MIME-Parser.pm.allow_no_trailing_boundary.diff	2010-05-05 18:26:15 UTC (rev 67325)
@@ -0,0 +1,59 @@
+--- lib/MIME/Parser.pm.orig	2010-05-03 16:02:52.000000000 -0700
++++ lib/MIME/Parser.pm	2010-05-04 11:08:48.000000000 -0700
+@@ -249,6 +249,7 @@
+     $self->{MP5_UUDecode}        = 0;
+     $self->{MP5_MaxParts}        = -1;
+     $self->{MP5_TmpDir}          = undef;
++    $self->{MP5_AllowNoTrailingBoundary}    = 0;
+ 
+     $self->interface(ENTITY_CLASS => 'MIME::Entity');
+     $self->interface(HEAD_CLASS   => 'MIME::Head');
+@@ -474,6 +475,28 @@
+ 
+ #------------------------------
+ 
++=item allow_no_trailing_boundary [YESNO]
++
++I<Instance method.>
++Controls whether the parser will ignore the error of a missing
++trailing MIME boundary.
++
++If YESNO is true, the parser will ignore missing trailing MIME
++boundaries.
++If YESNO is false (the default), a missing trailing MIME
++boundary is a fatal error
++With no argument, just returns the current setting.
++
++=cut
++
++sub allow_no_trailing_boundary {
++    my ($self, $yesno) = @_;
++    $self->{MP5_AllowNoTrailingBoundary} = $yesno if (@_ > 1);
++    $self->{MP5_AllowNoTrailingBoundary};
++}
++
++#------------------------------
++
+ =item decode_bodies [YESNO]
+ 
+ I<Instance method.>
+@@ -747,6 +770,7 @@
+ 	$eos_type = $part_rdr->eos_type;
+ 	if    ($eos_type eq 'DELIM') { $more_parts = 1 }
+ 	elsif ($eos_type eq 'CLOSE') { $more_parts = 0; }
++	elsif ($self->allow_no_trailing_boundary() && $eos_type eq 'EOF') { $more_parts = 0; }
+ 	else                         { $self->error("unexpected end of parts ".
+ 						    "before epilogue\n");
+ 				       return 1; }
+@@ -806,9 +830,9 @@
+ 	### ...and look at how we finished up.
+ 	###     If we have bounds, we want DELIM or CLOSE.
+ 	###     Otherwise, we want EOF (and that's all we'd get, anyway!).
+-	if ($rdr->has_bounds) {
++	if ((!$self->allow_no_trailing_boundary()) && ($rdr->has_bounds)) {
+ 	    ($rdr->eos_type =~ /^(DELIM|CLOSE)$/) or
+-		$self->error("part did not end with expected boundary\n");
++	    $self->error("part did not end with expected boundary\n");
+ 	}
+ 
+ 	### Flush and rewind encoded buffer, so we can read it:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100505/0fa32d76/attachment.html>


More information about the macports-changes mailing list