r3248 - in /packages/libemail-abstract-perl: ./ branches/ branches/upstream/ branches/upstream/current/ branches/upstream/current/lib/ branches/upstream/current/lib/Email/ branches/upstream/current/lib/Email/Abstract/ branches/upstream/current/t/ tags/

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sat Jul 8 19:12:47 UTC 2006


Author: gregoa-guest
Date: Sat Jul  8 19:12:46 2006
New Revision: 3248

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=3248
Log:
[svn-inject] Installing original source of libemail-abstract-perl

Added:
    packages/libemail-abstract-perl/
    packages/libemail-abstract-perl/branches/
    packages/libemail-abstract-perl/branches/upstream/
    packages/libemail-abstract-perl/branches/upstream/current/
    packages/libemail-abstract-perl/branches/upstream/current/Changes
    packages/libemail-abstract-perl/branches/upstream/current/MANIFEST
    packages/libemail-abstract-perl/branches/upstream/current/META.yml
    packages/libemail-abstract-perl/branches/upstream/current/Makefile.PL
    packages/libemail-abstract-perl/branches/upstream/current/README
    packages/libemail-abstract-perl/branches/upstream/current/lib/
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract.pm
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailMIME.pm
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailSimple.pm
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MIMEEntity.pm
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailInternet.pm
    packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailMessage.pm
    packages/libemail-abstract-perl/branches/upstream/current/t/
    packages/libemail-abstract-perl/branches/upstream/current/t/1.t
    packages/libemail-abstract-perl/branches/upstream/current/t/subclass.t
    packages/libemail-abstract-perl/tags/

Added: packages/libemail-abstract-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/Changes?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/Changes (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/Changes Sat Jul  8 19:12:46 2006
@@ -1,0 +1,14 @@
+Revision history for Perl extension Email::Abstract.
+
+2.01    2004-11-04
+
+  - Minor Documentation Fix
+  - Author Change
+  - PEP Contact Added
+
+2.0   Wed Aug 25 12:12:37 BST 2004
+    - Handle subclasses
+0.01  Wed May 26 16:47:20 2004
+	- original version; created by h2xs 1.22 with options
+		-AX -b 5.6.0 -n Email::Abstract
+

Added: packages/libemail-abstract-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/MANIFEST?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/MANIFEST (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/MANIFEST Sat Jul  8 19:12:46 2006
@@ -1,0 +1,13 @@
+Changes
+lib/Email/Abstract.pm
+lib/Email/Abstract/EmailMIME.pm
+lib/Email/Abstract/EmailSimple.pm
+lib/Email/Abstract/MailInternet.pm
+lib/Email/Abstract/MailMessage.pm
+lib/Email/Abstract/MIMEEntity.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+t/1.t
+t/subclass.t

Added: packages/libemail-abstract-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/META.yml?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/META.yml (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/META.yml Sat Jul  8 19:12:46 2006
@@ -1,0 +1,13 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         Email-Abstract
+version:      2.01
+version_from: lib/Email/Abstract.pm
+installdirs:  site
+requires:
+    Email::Simple:                 1.91
+    Module::Pluggable:             1.5
+    Test::More:                    0.47
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17

Added: packages/libemail-abstract-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/Makefile.PL?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/Makefile.PL (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/Makefile.PL Sat Jul  8 19:12:46 2006
@@ -1,0 +1,13 @@
+use 5.006;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    NAME              => 'Email::Abstract',
+    VERSION_FROM      => 'lib/Email/Abstract.pm', # finds $VERSION
+               PREREQ_PM     => {
+                                 'Email::Simple' => '1.91',
+                                 'Module::Pluggable' => '1.5',
+                                 'Test::More' => '0.47',
+                                },
+);

Added: packages/libemail-abstract-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/README?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/README (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/README Sat Jul  8 19:12:46 2006
@@ -1,0 +1,66 @@
+NAME
+    Email::Abstract - Unified interface to mail representations
+
+SYNOPSIS
+      my $message = Mail::Message->read($rfc822)
+                    || Email::Simple->new($rfc822)
+                    || Mail::Internet->new([split /\n/, $rfc822])
+                    || ...;
+
+      my $subject = Email::Abstract->get_header($message, "Subject");
+      Email::Abstract->set_header($message, "Subject", "My new subject");
+
+      my $body = Email::Abstract->get_body($message);
+      Email::Abstract->set_body($message, "Hello\nTest message\n");
+
+      $rfc822 = Email::Abstract->as_string($message);
+
+      my $mail_message = Email::Abstract->cast($message, "Mail::Message");
+
+DESCRIPTION
+    "Email::Abstract" provides module writers with the ability to write
+    representation-independent mail handling code. For instance, in the
+    cases of "Mail::Thread" or "Mail::ListDetector", a key part of the code
+    involves reading the headers from a mail object. Where previously one
+    would either have to specify the mail class required, or to build a new
+    object from scratch, "Email::Abstract" can be used to perform certain
+    simple operations on an object regardless of its underlying
+    representation.
+
+    "Email::Abstract" currently supports "Mail::Internet", "MIME::Entity",
+    "Mail::Message", "Email::Simple" and "Email::MIME". Other
+    representations are encouraged to create their own "Email::Abstract::*"
+    class by copying "Email::Abstract::EmailSimple". All modules installed
+    under the "Email::Abstract" hierarchy will be automatically picked up
+    and used.
+
+METHODS
+  get_header($obj, $header)
+    This returns the value or list of values of the given header.
+
+  set_header($obj, $header, @lines)
+    This sets the $header header to the given one or more values.
+
+  get_body($obj)
+    This returns the body as a string.
+
+  set_body($obj, $string)
+    This changes the body of the email to the given string.
+
+  as_string($obj)
+    This returns the whole email as a string.
+
+AUTHOR
+    Casey West, <casey at geeknest.com>
+
+    Simon Cozens, <simon at cpan.org>
+
+COPYRIGHT AND LICENSE
+    Copyright 2004 by Simon Cozens
+
+    This library is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+
+SEE ALSO
+    http://pep.kwiki.org
+

Added: packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract.pm?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract.pm (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract.pm Sat Jul  8 19:12:46 2006
@@ -1,0 +1,134 @@
+package Email::Abstract;
+use Carp;
+use Email::Simple;
+use 5.006;
+use strict;
+use warnings;
+our $VERSION = '2.01';
+use Module::Pluggable search_path => [ __PACKAGE__ ], require => 1;
+my @plugins = __PACKAGE__->plugins(); # Requires them.
+for my $func (qw(get_header get_body 
+                 set_header set_body 
+                 as_string)) {
+    no strict 'refs';
+    *$func  = sub { 
+        my ($class, $thing, @args) = @_;
+        $thing = Email::Simple->new($thing) unless ref $thing;
+        my $target = ref $thing;
+        $target =~ s/:://g;
+        $class .= "::".$target;
+        if ($class->can($func)) {
+            $class->$func($thing, @args);
+        } else {
+            for my $class (@plugins) { 
+                if ($class->can("target") and $thing->isa($class->target)) {
+                    return $class->$func($thing, @args);
+                }
+            }
+            croak "Don't know how to handle ".ref($thing);
+        }
+    };
+}
+
+sub cast {
+    my ($class, $thing, $target) = @_;
+    $thing = $class->as_string($thing) if ref $thing;
+    $target =~ s/:://g;
+    $class .= "::".$target;
+    if ($class->can("construct")) {
+        $class->construct($thing);
+    } else {
+        for my $class (@plugins) { 
+            if ($class->can("target") and $thing->isa($class->target)) {
+                return $class->construct($thing);
+            }
+        }
+        croak "Don't know how to handle $class";
+    }
+}
+
+# Preloaded methods go here.
+
+1;
+__END__
+# Below is stub documentation for your module. You'd better edit it!
+
+=head1 NAME
+
+Email::Abstract - Unified interface to mail representations
+
+=head1 SYNOPSIS
+
+  my $message = Mail::Message->read($rfc822)
+                || Email::Simple->new($rfc822)
+                || Mail::Internet->new([split /\n/, $rfc822])
+                || ...;
+
+  my $subject = Email::Abstract->get_header($message, "Subject");
+  Email::Abstract->set_header($message, "Subject", "My new subject");
+
+  my $body = Email::Abstract->get_body($message);
+  Email::Abstract->set_body($message, "Hello\nTest message\n");
+
+  $rfc822 = Email::Abstract->as_string($message);
+
+  my $mail_message = Email::Abstract->cast($message, "Mail::Message");
+
+=head1 DESCRIPTION
+
+C<Email::Abstract> provides module writers with the ability to write
+representation-independent mail handling code. For instance, in the
+cases of C<Mail::Thread> or C<Mail::ListDetector>, a key part of the
+code involves reading the headers from a mail object. Where previously
+one would either have to specify the mail class required, or to build a
+new object from scratch, C<Email::Abstract> can be used to perform
+certain simple operations on an object regardless of its underlying
+representation.
+
+C<Email::Abstract> currently supports C<Mail::Internet>,
+C<MIME::Entity>, C<Mail::Message>, C<Email::Simple> and C<Email::MIME>.
+Other representations are encouraged to create their own
+C<Email::Abstract::*> class by copying C<Email::Abstract::EmailSimple>.
+All modules installed under the C<Email::Abstract> hierarchy will be
+automatically picked up and used.
+
+=head1 METHODS
+
+=head2 get_header($obj, $header)
+
+This returns the value or list of values of the given header.
+
+=head2 set_header($obj, $header, @lines)
+
+This sets the C<$header> header to the given one or more values.
+
+=head2 get_body($obj)
+
+This returns the body as a string.
+
+=head2 set_body($obj, $string)
+
+This changes the body of the email to the given string.
+
+=head2 as_string($obj)
+
+This returns the whole email as a string.
+
+=head1 AUTHOR
+
+Casey West, <F<casey at geeknest.com>>
+
+Simon Cozens, <F<simon at cpan.org>>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2004 by Simon Cozens
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself. 
+
+=head1 SEE ALSO
+
+http://pep.kwiki.org
+
+=cut

Added: packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailMIME.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailMIME.pm?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailMIME.pm (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailMIME.pm Sat Jul  8 19:12:46 2006
@@ -1,0 +1,28 @@
+package Email::Abstract::EmailMIME;
+use strict;
+use base 'Email::Abstract::EmailSimple';
+sub target { "Email::MIME" }
+
+sub construct {
+    require Email::MIME;
+    my ($class, $rfc822) = @_;
+    Email::MIME->new($rfc822);
+}
+
+1;
+
+=head1 NAME
+
+Email::Abstract::EmailMIME - Email::Abstract wrapper for Email::MIME
+
+=head1 DESCRIPTION
+
+This module wraps the Email::MIME mail handling library with an
+abstract interface, to be used with L<Email::Abstract>
+
+=head1 SEE ALSO
+
+L<Email::Abstract>, L<Email::MIME>.
+
+=cut
+

Added: packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailSimple.pm?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailSimple.pm (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/EmailSimple.pm Sat Jul  8 19:12:46 2006
@@ -1,0 +1,51 @@
+package Email::Abstract::EmailSimple;
+use strict;
+sub target { "Email::Simple" }
+
+sub construct {
+    require Email::Simple;
+    my ($class, $rfc822) = @_;
+    Email::Simple->new($rfc822);
+}
+sub get_header { 
+    my ($class, $obj, $header) = @_; 
+    $obj->header($header); 
+}
+
+sub get_body   { 
+    my ($class, $obj) = @_; 
+    $obj->body();
+}
+
+sub set_header { 
+    my ($class, $obj, $header, @data) = @_; 
+    $obj->header_set($header, @data); 
+}
+
+sub set_body   {
+    my ($class, $obj, $body) = @_; 
+    $obj->body_set($body); 
+}
+
+sub as_string { 
+    my ($class, $obj) = @_; 
+    $obj->as_string();
+}
+
+1;
+
+=head1 NAME
+
+Email::Abstract::EmailSimple - Email::Abstract wrapper for Email::Simple
+
+=head1 DESCRIPTION
+
+This module wraps the Email::Simple mail handling library with an
+abstract interface, to be used with L<Email::Abstract>
+
+=head1 SEE ALSO
+
+L<Email::Abstract>, L<Email::Simple>.
+
+=cut
+

Added: packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MIMEEntity.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MIMEEntity.pm?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MIMEEntity.pm (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MIMEEntity.pm Sat Jul  8 19:12:46 2006
@@ -1,0 +1,40 @@
+package Email::Abstract::MIMEEntity;
+use strict;
+use base 'Email::Abstract::MailInternet';
+sub target { "MIME::Entity" }
+
+sub construct {
+    require MIME::Parser;
+    my $parser = new MIME::Parser;
+    $parser->output_to_core(1);
+    my ($class, $rfc822) = @_;
+    $parser->parse_data($rfc822);
+}
+
+sub get_body { pop->bodyhandle->as_string }
+
+sub set_body {
+    my ($class, $obj, $body) = @_;
+    my @lines = split /\n/, $body;
+    my $io = $obj->bodyhandle->open("w");
+    foreach (@lines) { $io->print($_."\n") }
+    $io->close;
+}
+
+1;
+
+=head1 NAME
+
+Email::Abstract::MIMEEntity - Email::Abstract wrapper for MIME::Entity
+
+=head1 DESCRIPTION
+
+This module wraps the MIME::Entity mail handling library with an
+abstract interface, to be used with L<Email::Abstract>
+
+=head1 SEE ALSO
+
+L<Email::Abstract>, L<MIME::Entity>.
+
+=cut
+

Added: packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailInternet.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailInternet.pm?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailInternet.pm (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailInternet.pm Sat Jul  8 19:12:46 2006
@@ -1,0 +1,50 @@
+package Email::Abstract::MailInternet;
+use strict;
+sub target { "Mail::Internet" }
+
+sub construct {
+    require Mail::Internet;
+    my ($class, $rfc822) = @_;
+    Mail::Internet->new([ split /\n/, $rfc822]);
+}
+
+sub get_header { 
+    my ($class, $obj, $header) = @_; 
+    $obj->head->get($header); 
+}
+
+sub get_body   { 
+    my ($class, $obj) = @_; 
+    join "\n", @{$obj->body()};
+}
+
+sub set_header { 
+    my ($class, $obj, $header, @data) = @_; 
+    my $count = 0;
+    $obj->head->replace($header, shift @data, ++$count) while @data; 
+}
+
+sub set_body   {
+    my ($class, $obj, $body) = @_; 
+    $obj->body( split /\n/, $body ); 
+}
+
+sub as_string { my ($class, $obj) = @_; $obj->as_string(); }
+
+1;
+
+=head1 NAME
+
+Email::Abstract::MailInternet - Email::Abstract wrapper for Mail::Internet
+
+=head1 DESCRIPTION
+
+This module wraps the Mail::Internet mail handling library with an
+abstract interface, to be used with L<Email::Abstract>
+
+=head1 SEE ALSO
+
+L<Email::Abstract>, L<Mail::Internet>.
+
+=cut
+

Added: packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailMessage.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailMessage.pm?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailMessage.pm (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/lib/Email/Abstract/MailMessage.pm Sat Jul  8 19:12:46 2006
@@ -1,0 +1,53 @@
+package Email::Abstract::MailMessage;
+use strict;
+sub target {"Mail::Message" }
+
+sub construct {
+    require Mail::Message;
+    my ($class, $rfc822) = @_;
+    Mail::Message->read($rfc822);
+}
+sub get_header { 
+    my ($class, $obj, $header) = @_; 
+    $obj->head->get($header);
+}
+
+sub get_body   { 
+    my ($class, $obj) = @_; 
+    $obj->decoded->string;
+}
+
+sub set_header { 
+    my ($class, $obj, $header, @data) = @_; 
+    $obj->head->delete($header);
+    $obj->head->add($header, $_) for @data; # Madness
+}
+
+sub set_body   {
+    my ($class, $obj, $body) = @_; 
+    $obj->body(Mail::Message::Body->new(data => [split /\n/, $body]));
+    # Madness, madness
+}
+
+sub as_string { 
+    my ($class, $obj) = @_; 
+    $obj->string();
+}
+
+1;
+
+=head1 NAME
+
+Email::Abstract::MailMessage - Email::Abstract wrapper for Mail::Message
+
+=head1 DESCRIPTION
+
+This module wraps the Mail::Message mail handling library with an
+abstract interface, to be used with L<Email::Abstract>
+
+=head1 SEE ALSO
+
+L<Email::Abstract>, L<Mail::Message>.
+
+=cut
+

Added: packages/libemail-abstract-perl/branches/upstream/current/t/1.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/t/1.t?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/t/1.t (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/t/1.t Sat Jul  8 19:12:46 2006
@@ -1,0 +1,126 @@
+use Test::More "no_plan";
+use_ok("Email::Abstract");
+my $message = do { local $/; <DATA>; };
+
+for my $class (
+    qw(Email::MIME Email::Simple MIME::Entity Mail::Internet Mail::Message)) {
+    eval "require $class"; next if $@;
+    print "# $class\n";
+    my $obj = Email::Abstract->cast($message, $class);
+    isa_ok($obj, $class);
+    like(Email::Abstract->get_header($obj, "Subject"), qr/Re: Defect in XBD lround/, "Subject OK");
+    like(Email::Abstract->get_body($obj), qr/Fred Tydeman/, "Body OK");
+    Email::Abstract->set_header($obj, "Subject", "New Subject");
+    Email::Abstract->set_body($obj, "A completely new body");
+    like(Email::Abstract->as_string($obj), 
+        qr/Subject: New Subject.*completely new body$/ms, 
+        "Set and stringified");
+}
+
+__DATA__
+From mail-miner-10529 at localhost Wed Dec 18 12:07:55 2002
+Received: from mailman.opengroup.org ([192.153.166.9])
+	by deep-dark-truthful-mirror.pad with smtp (Exim 3.36 #1 (Debian))
+	id 18Buh5-0006Zr-00
+	for <posix at simon-cozens.org>; Wed, 13 Nov 2002 10:24:23 +0000
+Received: (qmail 1679 invoked by uid 503); 13 Nov 2002 10:10:49 -0000
+Resent-Date: 13 Nov 2002 10:10:49 -0000
+Date: Wed, 13 Nov 2002 10:06:51 GMT
+From: Andrew Josey <ajosey at rdg.opengroup.org>
+Message-Id: <1021113100650.ZM12997 at skye.rdg.opengroup.org>
+In-Reply-To: Joanna Farley's message as of Nov 13,  9:56am.
+References: <200211120937.JAA28130 at xoneweb.opengroup.org> 
+	<1021112125524.ZM7503 at skye.rdg.opengroup.org> 
+	<3DD221BB.13116D47 at sun.com>
+X-Mailer: Z-Mail (5.0.0 30July97)
+To: austin-group-l at opengroup.org
+Subject: Re: Defect in XBD lround
+MIME-Version: 1.0
+Resent-Message-ID: <gZGK1B.A.uY.iUi09 at mailman>
+Resent-To: austin-group-l at opengroup.org
+Resent-From: austin-group-l at opengroup.org
+X-Mailing-List: austin-group-l:archive/latest/4823
+X-Loop: austin-group-l at opengroup.org
+Precedence: list
+X-Spam-Status: No, hits=-1.6 required=5.0
+Resent-Sender: austin-group-l-request at opengroup.org
+Content-Type: text/plain; charset=us-ascii
+
+Joanna, All
+
+Thanks. I got the following response from Fred Tydeman.
+
+C99 Defect Report (DR) 240 covers this.  The main body of C99
+(7.12.9.7) says range error, while Annex F (F.9.6.7 and F.9.6.5)
+says "invalid" (domain error).  The result was to change 7.12.9.7
+to allow for either range or domain error.  The preferred error
+is domain error (so as match Annex F).  So, no need to change XBD.
+
+regards
+Andrew
+
+On Nov 13,  9:56am in "Re: Defect in XBD lr", Joanna Farley wrote:
+> Sun's expert in this area after some discussions with a colleague
+> outside of Sun concluded that for lround, to align with both C99 and SUS
+> changes of the following form were necessary:
+> 
+> 	+ If x is +/-Inf/NaN, a domain error occurs, and
+> 		+ errno is set to EDOM in MATH_ERRNO mode;
+> 		+ the invalid exception is raised in MATH_ERREXCEPT mode.
+> 		[to align with C99 Annex F.4]
+>         
+> 	+ If x is too large to be represented as a long, a *range* error
+> 	may occur, and
+> 		+ errno *may be* set to ERANGE in MATH_ERRNO mode;
+> 		[to align with C99 7.12.9.7]
+> 		+ the invalid exception *is* raised in MATH_ERREXCEPT mode.
+> 		[to align with C99 Annex F.4]
+> 
+> They believe it is a bit awkward to have errno set to ERANGE in
+> MATH_ERRNO mode yet the invalid exception raised in MAH_ERREXCEPT mode,
+> but that just reflects an imperfect mapping of the C notion of errno to
+> the IEEE 754 notion of data conversion.
+> 
+> I'll work with our expert to draft text refecting the above to suggest
+> replacement text for lines 23678-23684 on lround page 721 of XSH6.
+> 
+> Thanks
+> 
+> Joanna
+> 
+> 
+> Andrew Josey wrote:
+> > 
+> > The text referred to is MX shaded and part of the ISO 60559 floating
+> > point option.  I do not think changing the Domain Error to a Range Error
+> > is the fix or at least not the fix for the NaN and +-Inf cases.  ISO C
+> > 99 describes the range error case if the magnitude of x is too large as a
+> > may fail. I'll ask Fred T for his thoughts on this one...
+> > regards
+> > Andrew
+> > 
+> > On Nov 12,  9:37am in "Defect in XBD lround", Erwin.Unruh at fujitsu-siemens.com wrote:
+> > >       Defect report from : Erwin Unruh , Fujitsu Siemens Computers
+> > >
+> > > (Please direct followup comments direct to austin-group-l at opengroup.org)
+> > >
+> > > @ page 0 line 0 section lround objection {0}
+> > >
+> > > Problem:
+> > >
+> > > Defect code :  1. Error
+> > >
+> > > The function lround is described in http://www.opengroup.org/onlinepubs/007904975/functions/lround.html
+> > > On Error it is specified that errno has to be set to EDOM. However, the C99 standard ISO/IEC 9899:1999 (E) specifies this as a range error, which would result in a value of ERANGE. So an implementation could not be conformant to both these standards.
+> > >
+> > > Action:
+> > >
+> > > Change the value of errno to ERANGE, if the result is not represantable. More specific: In the description of the function, replace all occurences of "domain error" with "range error" and replace "EDOM" with "ERANGE"
+> > >-- End of excerpt from Erwin.Unruh at fujitsu-siemens.com
+> > 
+
+-----
+Andrew Josey                                The Open Group  
+Austin Group Chair                          Apex Plaza,Forbury Road,
+Email: a.josey at opengroup.org                Reading,Berks.RG1 1AX,England
+Tel:   +44 118 9508311 ext 2250             Fax: +44 118 9500110

Added: packages/libemail-abstract-perl/branches/upstream/current/t/subclass.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-abstract-perl/branches/upstream/current/t/subclass.t?rev=3248&op=file
==============================================================================
--- packages/libemail-abstract-perl/branches/upstream/current/t/subclass.t (added)
+++ packages/libemail-abstract-perl/branches/upstream/current/t/subclass.t Sat Jul  8 19:12:46 2006
@@ -1,0 +1,117 @@
+package MyMail;
+use base "Email::Simple";
+1;
+
+package main;
+use Test::More tests => 1;
+use Email::Abstract;
+my $message = do { local $/; <DATA>; };
+my $x = MyMail->new($message);
+like (Email::Abstract->as_string($x), qr/Farley's/, "Round trip with subclass");
+
+__DATA__
+Received: from mailman.opengroup.org ([192.153.166.9])
+	by deep-dark-truthful-mirror.pad with smtp (Exim 3.36 #1 (Debian))
+	id 18Buh5-0006Zr-00
+	for <posix at simon-cozens.org>; Wed, 13 Nov 2002 10:24:23 +0000
+Received: (qmail 1679 invoked by uid 503); 13 Nov 2002 10:10:49 -0000
+Resent-Date: 13 Nov 2002 10:10:49 -0000
+Date: Wed, 13 Nov 2002 10:06:51 GMT
+From: Andrew Josey <ajosey at rdg.opengroup.org>
+Message-Id: <1021113100650.ZM12997 at skye.rdg.opengroup.org>
+In-Reply-To: Joanna Farley's message as of Nov 13,  9:56am.
+References: <200211120937.JAA28130 at xoneweb.opengroup.org> 
+	<1021112125524.ZM7503 at skye.rdg.opengroup.org> 
+	<3DD221BB.13116D47 at sun.com>
+X-Mailer: Z-Mail (5.0.0 30July97)
+To: austin-group-l at opengroup.org
+Subject: Re: Defect in XBD lround
+MIME-Version: 1.0
+Resent-Message-ID: <gZGK1B.A.uY.iUi09 at mailman>
+Resent-To: austin-group-l at opengroup.org
+Resent-From: austin-group-l at opengroup.org
+X-Mailing-List: austin-group-l:archive/latest/4823
+X-Loop: austin-group-l at opengroup.org
+Precedence: list
+X-Spam-Status: No, hits=-1.6 required=5.0
+Resent-Sender: austin-group-l-request at opengroup.org
+Content-Type: text/plain; charset=us-ascii
+
+Joanna, All
+
+Thanks. I got the following response from Fred Tydeman.
+
+C99 Defect Report (DR) 240 covers this.  The main body of C99
+(7.12.9.7) says range error, while Annex F (F.9.6.7 and F.9.6.5)
+says "invalid" (domain error).  The result was to change 7.12.9.7
+to allow for either range or domain error.  The preferred error
+is domain error (so as match Annex F).  So, no need to change XBD.
+
+regards
+Andrew
+
+On Nov 13,  9:56am in "Re: Defect in XBD lr", Joanna Farley wrote:
+> Sun's expert in this area after some discussions with a colleague
+> outside of Sun concluded that for lround, to align with both C99 and SUS
+> changes of the following form were necessary:
+> 
+> 	+ If x is +/-Inf/NaN, a domain error occurs, and
+> 		+ errno is set to EDOM in MATH_ERRNO mode;
+> 		+ the invalid exception is raised in MATH_ERREXCEPT mode.
+> 		[to align with C99 Annex F.4]
+>         
+> 	+ If x is too large to be represented as a long, a *range* error
+> 	may occur, and
+> 		+ errno *may be* set to ERANGE in MATH_ERRNO mode;
+> 		[to align with C99 7.12.9.7]
+> 		+ the invalid exception *is* raised in MATH_ERREXCEPT mode.
+> 		[to align with C99 Annex F.4]
+> 
+> They believe it is a bit awkward to have errno set to ERANGE in
+> MATH_ERRNO mode yet the invalid exception raised in MAH_ERREXCEPT mode,
+> but that just reflects an imperfect mapping of the C notion of errno to
+> the IEEE 754 notion of data conversion.
+> 
+> I'll work with our expert to draft text refecting the above to suggest
+> replacement text for lines 23678-23684 on lround page 721 of XSH6.
+> 
+> Thanks
+> 
+> Joanna
+> 
+> 
+> Andrew Josey wrote:
+> > 
+> > The text referred to is MX shaded and part of the ISO 60559 floating
+> > point option.  I do not think changing the Domain Error to a Range Error
+> > is the fix or at least not the fix for the NaN and +-Inf cases.  ISO C
+> > 99 describes the range error case if the magnitude of x is too large as a
+> > may fail. I'll ask Fred T for his thoughts on this one...
+> > regards
+> > Andrew
+> > 
+> > On Nov 12,  9:37am in "Defect in XBD lround", Erwin.Unruh at fujitsu-siemens.com wrote:
+> > >       Defect report from : Erwin Unruh , Fujitsu Siemens Computers
+> > >
+> > > (Please direct followup comments direct to austin-group-l at opengroup.org)
+> > >
+> > > @ page 0 line 0 section lround objection {0}
+> > >
+> > > Problem:
+> > >
+> > > Defect code :  1. Error
+> > >
+> > > The function lround is described in http://www.opengroup.org/onlinepubs/007904975/functions/lround.html
+> > > On Error it is specified that errno has to be set to EDOM. However, the C99 standard ISO/IEC 9899:1999 (E) specifies this as a range error, which would result in a value of ERANGE. So an implementation could not be conformant to both these standards.
+> > >
+> > > Action:
+> > >
+> > > Change the value of errno to ERANGE, if the result is not represantable. More specific: In the description of the function, replace all occurences of "domain error" with "range error" and replace "EDOM" with "ERANGE"
+> > >-- End of excerpt from Erwin.Unruh at fujitsu-siemens.com
+> > 
+
+-----
+Andrew Josey                                The Open Group  
+Austin Group Chair                          Apex Plaza,Forbury Road,
+Email: a.josey at opengroup.org                Reading,Berks.RG1 1AX,England
+Tel:   +44 118 9508311 ext 2250             Fax: +44 118 9500110




More information about the Pkg-perl-cvs-commits mailing list