1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00

Upgrade to 6.200_02.

PR:		ports/58066
Submitted by:	"Ying-Chieh Chen" <yinjieh@csie.nctu.edu.tw>
This commit is contained in:
Jun Kuriyama 2003-10-26 09:21:50 +00:00
parent 8303f12166
commit 72274ff7f4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=92189
5 changed files with 55 additions and 138 deletions

View File

@ -6,22 +6,22 @@
#
PORTNAME= p5-MIME-Tools
PORTVERSION= 5.411a
PORTREVISION= 2
PORTVERSION= 6.200.02
CATEGORIES= mail perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
MASTER_SITE_SUBDIR= MIME
DISTNAME= MIME-tools-${PORTVERSION}
MASTER_SITE_SUBDIR= ../../authors/id/E/ER/ERYQ
DISTNAME= MIME-tools-${PORTVERSION:R}_${PORTVERSION:E}
MAINTAINER= kuriyama@FreeBSD.org
COMMENT= A set of perl5 modules for MIME
BUILD_DEPENDS= ${SITE_PERL}/Mail/Header.pm:${PORTSDIR}/mail/p5-Mail-Tools \
${SITE_PERL}/IO/Wrap.pm:${PORTSDIR}/devel/p5-IO-stringy
${SITE_PERL}/IO/Wrap.pm:${PORTSDIR}/devel/p5-IO-stringy \
${SITE_PERL}/${PERL_ARCH}/Unicode/Map.pm:${PORTSDIR}/converters/p5-Unicode-Map \
${SITE_PERL}/${PERL_ARCH}/Unicode/String.pm:${PORTSDIR}/converters/p5-Unicode-String
RUN_DEPENDS= ${BUILD_DEPENDS}
PERL_CONFIGURE= YES
WRKSRC= ${WRKDIR}/MIME-tools-5.411
MAN3= MIME::Body.3 \
MIME::Decoder.3 \
@ -38,10 +38,32 @@ MAN3= MIME::Body.3 \
MIME::Field::ParamVal.3 \
MIME::Head.3 \
MIME::Parser.3 \
MIME::Parser::AbstractFiler.3 \
MIME::Parser::Filer.3 \
MIME::Parser::FlatFiler.3 \
MIME::Parser::Reader.3 \
MIME::Parser::Redoer.3 \
MIME::Parser::Results.3 \
MIME::Parser::TreeFiler.3 \
MIME::Parser::UURedoer.3 \
MIME::Tools.3 \
MIME::Tools::IndentingLogger.3 \
MIME::Tools::Logger.3 \
MIME::Tools::MailFieldParserForRFC2045.3 \
MIME::Tools::MailFieldTokenizerForRFC2045.3 \
MIME::Tools::NullLogger.3 \
MIME::Tools::PrefixingLogger.3 \
MIME::Tools::ToolkitLogger.3 \
MIME::Tools::Utils.3 \
MIME::Tools::changes.3 \
MIME::Tools::config.3 \
MIME::Tools::diag.3 \
MIME::Tools::faq.3 \
MIME::Tools::overview.3 \
MIME::Tools::primer.3 \
MIME::Tools::tips.3 \
MIME::Tools::traps.3 \
MIME::Tools::tricks.3 \
MIME::WordDecoder.3 \
MIME::Words.3
@ -51,8 +73,4 @@ MAN3= MIME::Body.3 \
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64
.endif
post-patch:
@${RM} -f ${WRKSRC}/lib/MIME/Field/ParamVal.pm.orig \
${WRKSRC}/lib/MIME/Words.pm.orig
.include <bsd.port.post.mk>

View File

@ -1 +1 @@
MD5 (MIME-tools-5.411a.tar.gz) = e7cb1f8e146171103640e3a5516afb1a
MD5 (MIME-tools-6.200_02.tar.gz) = 3d0b48a8b52e27618a899e0475d1c003

View File

@ -1,114 +0,0 @@
--- lib/MIME/Field/ParamVal.pm.orig Sun Nov 5 04:54:49 2000
+++ lib/MIME/Field/ParamVal.pm Thu Jun 6 10:15:15 2002
@@ -100,6 +100,9 @@
# token = 1*<any (ASCII) CHAR except SPACE, CTLs, or tspecials>
#
my $TSPECIAL = '()<>@,;:\</[]?="';
+
+#" Fix emacs highlighting...
+
my $TOKEN = '[^ \x00-\x1f\x80-\xff' . "\Q$TSPECIAL\E" . ']+';
# Encoded token:
@@ -108,6 +111,9 @@
# Pattern to match spaces or comments:
my $SPCZ = '(?:\s|\([^\)]*\))*';
+# Pattern to match non-semicolon as fallback for broken MIME
+# produced by some viruses
+my $BADTOKEN = '[^;]+';
#------------------------------
#
@@ -181,10 +187,40 @@
=cut
+sub rfc2231decode {
+ my($val) = @_;
+ my($enc, $lang, $rest);
+
+ if ($val =~ m/^([^\']*)\'([^\']*)\'(.*)$/) {
+ # SHOULD REALLY DO SOMETHING MORE INTELLIGENT WITH ENCODING!!!
+ $enc = $1;
+ $lang = $2;
+ $rest = $3;
+ $rest = rfc2231percent($rest);
+ } elsif ($val =~ m/^([^\']*)\'([^\']*)$/) {
+ $enc = $1;
+ $rest = $2;
+ $rest = rfc2231percent($rest);
+ } else {
+ $rest = rfc2231percent($val);
+ }
+ return $rest;
+}
+
+sub rfc2231percent {
+ # Do percent-subsitution
+ my($str) = @_;
+ $str =~ s/%([0-9a-fA-F]{2})/pack("c", hex($1))/ge;
+ return $str;
+}
+
sub parse_params {
my ($self, $raw) = @_;
my %params = ();
+ my %rfc2231params = ();
my $param;
+ my $val;
+ my $part;
# Get raw field, and unfold it:
defined($raw) or $raw = '';
@@ -200,9 +236,47 @@
$raw =~ m/\G$SPCZ\;$SPCZ/og or last; # skip leading separator
$raw =~ m/\G($PARAMNAME)\s*=\s*/og or last; # give up if not a param
$param = lc($1);
- $raw =~ m/\G(\"([^\"]+)\")|\G($TOKEN)|\G($ENCTOKEN)/g or last; # give up if no value
- my ($qstr, $str, $token, $enctoken) = ($1, $2, $3, $4);
- $params{$param} = defined($qstr) ? $str : (defined($token) ? $token : $enctoken);
+ $raw =~ m/\G(\"([^\"]+)\")|\G($ENCTOKEN)|\G($BADTOKEN)|\G($TOKEN)/g or last; # give up if no value"
+ my ($qstr, $str, $enctoken, $badtoken, $token) = ($1, $2, $3, $4, $5);
+ if (defined($badtoken)) {
+ # Strip leading/trailing whitespace from badtoken
+ $badtoken =~ s/^\s*//;
+ $badtoken =~ s/\s*$//;
+ }
+ $val = defined($qstr) ? $str :
+ (defined($enctoken) ? $enctoken :
+ (defined($badtoken) ? $badtoken : $token));
+
+ # Do RFC 2231 processing
+ if ($param =~ /\*/) {
+ my($name, $num);
+ # Pick out the parts of the parameter
+ if ($param =~ m/^([^*]+)\*([^*]+)\*?$/) {
+ # We have param*number* or param*number
+ $name = $1;
+ $num = $2;
+ } else {
+ # Fake a part of zero... not sure how to handle this properly
+ $param =~ s/\*//g;
+ $name = $param;
+ $num = 0;
+ }
+ # Decode the value unless it was a quoted string
+ if (!defined($qstr)) {
+ $val = rfc2231decode($val);
+ }
+ $rfc2231params{$name}{$num} .= $val;
+ } else {
+ # Make a fake "part zero" for non-RFC2231 params
+ $rfc2231params{$param}{"0"} = $val;
+ }
+ }
+
+ # Extract reconstructed parameters
+ foreach $param (keys %rfc2231params) {
+ foreach $part (sort { $a <=> $b } keys %{$rfc2231params{$param}}) {
+ $params{$param} .= $rfc2231params{$param}{$part};
+ }
debug " field param <$param> = <$params{$param}>";
}

View File

@ -1,11 +0,0 @@
--- lib/MIME/Words.pm.orig Sat Nov 11 01:45:12 2000
+++ lib/MIME/Words.pm Thu Jun 6 10:15:15 2002
@@ -186,7 +186,7 @@
$@ = ''; ### error-return
### Collapse boundaries between adjacent encoded words:
- $encstr =~ s{(\?\=)\r?\n[ \t](\=\?)}{$1$2}gs;
+ $encstr =~ s{(\?\=)\s*(\=\?)}{$1$2}gs;
pos($encstr) = 0;
### print STDOUT "ENC = [", $encstr, "]\n";

View File

@ -1,22 +1,45 @@
%%SITE_PERL%%/MIME/Body.pm
%%SITE_PERL%%/MIME/Entity.pm
%%SITE_PERL%%/MIME/Decoder.pm
%%SITE_PERL%%/MIME/Decoder/QuotedPrint.pm
%%SITE_PERL%%/MIME/Decoder/Base64.pm
%%SITE_PERL%%/MIME/Decoder/Binary.pm
%%SITE_PERL%%/MIME/Decoder/Gzip64.pm
%%SITE_PERL%%/MIME/Decoder/NBit.pm
%%SITE_PERL%%/MIME/Decoder/QuotedPrint.pm
%%SITE_PERL%%/MIME/Decoder/UU.pm
%%SITE_PERL%%/MIME/Entity.pm
%%SITE_PERL%%/MIME/Field/ConTraEnc.pm
%%SITE_PERL%%/MIME/Field/ContDisp.pm
%%SITE_PERL%%/MIME/Field/ContType.pm
%%SITE_PERL%%/MIME/Field/ParamVal.pm
%%SITE_PERL%%/MIME/Head.pm
%%SITE_PERL%%/MIME/Parser.pm
%%SITE_PERL%%/MIME/Parser/AbstractFiler.pm
%%SITE_PERL%%/MIME/Parser/Filer.pm
%%SITE_PERL%%/MIME/Parser/FlatFiler.pm
%%SITE_PERL%%/MIME/Parser/Reader.pm
%%SITE_PERL%%/MIME/Parser/Redoer.pm
%%SITE_PERL%%/MIME/Parser/Results.pm
%%SITE_PERL%%/MIME/Parser/TreeFiler.pm
%%SITE_PERL%%/MIME/Parser/UURedoer.pm
%%SITE_PERL%%/MIME/Tools.pm
%%SITE_PERL%%/MIME/Tools/IndentingLogger.pm
%%SITE_PERL%%/MIME/Tools/Logger.pm
%%SITE_PERL%%/MIME/Tools/MailFieldParserForRFC2045.pm
%%SITE_PERL%%/MIME/Tools/MailFieldTokenizerForRFC2045.pm
%%SITE_PERL%%/MIME/Tools/MailFieldTokenizerForRFC822.pm
%%SITE_PERL%%/MIME/Tools/NullLogger.pm
%%SITE_PERL%%/MIME/Tools/PrefixingLogger.pm
%%SITE_PERL%%/MIME/Tools/ToolkitLogger.pm
%%SITE_PERL%%/MIME/Tools/Utils.pm
%%SITE_PERL%%/MIME/Tools/changes.pod
%%SITE_PERL%%/MIME/Tools/config.pod
%%SITE_PERL%%/MIME/Tools/diag.pod
%%SITE_PERL%%/MIME/Tools/faq.pod
%%SITE_PERL%%/MIME/Tools/overview.pod
%%SITE_PERL%%/MIME/Tools/primer.pod
%%SITE_PERL%%/MIME/Tools/tips.pod
%%SITE_PERL%%/MIME/Tools/traps.pod
%%SITE_PERL%%/MIME/Tools/tricks.pod
%%SITE_PERL%%/MIME/WordDecoder.pm
%%SITE_PERL%%/MIME/Words.pm
%%SITE_PERL%%/%%PERL_ARCH%%/auto/MIME-tools/.packlist
@ -24,4 +47,5 @@
@dirrm %%SITE_PERL%%/MIME/Field
@dirrm %%SITE_PERL%%/MIME/Decoder
@dirrm %%SITE_PERL%%/MIME/Parser
@dirrm %%SITE_PERL%%/MIME/Tools
@unexec rmdir %D/%%SITE_PERL%%/MIME 2>/dev/null || true