[Orca-checkins] r267 - in trunk/orca: . packages/Digest-MD5-2.30 packages/Digest-MD5-2.33 packages/Digest-MD5-2.33/t

Blair Zajac blair at orcaware.com
Thu Jan 15 13:33:37 PST 2004


Author: blair
Date: Thu Jan 15 13:31:43 2004
New Revision: 267

Added:
   trunk/orca/packages/Digest-MD5-2.33/
      - copied from r266, trunk/orca/packages/Digest-MD5-2.30/
   trunk/orca/packages/Digest-MD5-2.33/t/bits.t
Removed:
   trunk/orca/packages/Digest-MD5-2.30/
Modified:
   trunk/orca/INSTALL
   trunk/orca/configure.in
   trunk/orca/packages/Digest-MD5-2.33/Changes
   trunk/orca/packages/Digest-MD5-2.33/MANIFEST
   trunk/orca/packages/Digest-MD5-2.33/MD5.pm
   trunk/orca/packages/Digest-MD5-2.33/MD5.xs
   trunk/orca/packages/Digest-MD5-2.33/Makefile.PL
   trunk/orca/packages/Digest-MD5-2.33/t/files.t
   trunk/orca/packages/Digest-MD5-2.33/typemap
Log:
Upgrade Digest::MD5 from 2.30 to 2.33 and require the new version for
Orca.

* INSTALL:
  Update all references to Digest::MD5's version number from 2.30 to
  2.33.

* configure.in:
  Bump Digest::MD5's version number to 2.33.

* packages/Digest-MD5-2.33:
  Renamed from packages/Digest-MD5-2.30.  Directory contents updated
  from Digest-MD5-2.33.tar.gz.


Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL	(original)
+++ trunk/orca/INSTALL	Thu Jan 15 13:31:43 2004
@@ -173,7 +173,7 @@
     Data::Dumper            >= 2.101       >= 2.101     2.101
     Date::Parse             Not required by Orca        2.24
     Devel::DProf            Not required by Orca        19990108
-    Digest::MD5             >= 2.30        >= 2.30      2.30
+    Digest::MD5             >= 2.33        >= 2.33      2.33
     Math::IntervalSearch    >= 1.05        >= 1.05      1.05
     RRDs                    >= 1.000451    >= 1.0.45    1.0.45
     Storable                >= 2.07        >= 2.07      2.07
@@ -227,10 +227,10 @@
 
     Digest::MD5
 
-      http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.30.tar.gz
+      http://www.perl.com/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.33.tar.gz
 
-      % gunzip -c Digest-MD5-2.30.tar.gz | tar xvf -
-      % cd Digest-MD5-2.30
+      % gunzip -c Digest-MD5-2.33.tar.gz | tar xvf -
+      % cd Digest-MD5-2.33
       % perl Makefile.PL
       % make
       % make test

Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	Thu Jan 15 13:31:43 2004
@@ -33,8 +33,8 @@
 DATE_PARSE_VER=2.24
 DEVEL_DPROF_DIR=DProf-19990108
 DEVEL_DPROF_VER=19990108
-DIGEST_MD5_DIR=Digest-MD5-2.30
-DIGEST_MD5_VER=2.30
+DIGEST_MD5_DIR=Digest-MD5-2.33
+DIGEST_MD5_VER=2.33
 MATH_INTERVALSEARCH_DIR=Math-Interpolate-1.05
 MATH_INTERVALSEARCH_VER=1.05
 RRDTOOL_DIR=rrdtool-1.0.45

Modified: trunk/orca/packages/Digest-MD5-2.33/Changes
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/Changes	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/Changes	Thu Jan 15 13:31:43 2004
@@ -1,3 +1,34 @@
+2003-12-07   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.33
+   
+   Enable explicit context passing for slight performance
+   improvement in threaded perls.
+   
+   Tweaks to the Makefile.PL so that it is suitable both for
+   core and CPAN use.
+
+
+
+2003-12-05   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.32
+
+   Don't run u32align test program on HP-UX 10.20 as it
+   will hang.  Patch by H.Merijn Brand <h.m.brand at hccnet.nl>.
+
+   Fixed documentation typo.
+
+
+
+2003-11-28   Gisle Aas <gisle at ActiveState.com>
+
+   Release 2.31
+
+   Inherit add_bits() from Digest::base if available.
+
+
+
 2003-10-09   Gisle Aas <gisle at ActiveState.com>
 
    Release 2.30

Modified: trunk/orca/packages/Digest-MD5-2.33/MANIFEST
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/MANIFEST	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/MANIFEST	Thu Jan 15 13:31:43 2004
@@ -10,6 +10,7 @@
 rfc1321.txt		The MD5 Message-Digest Algorithm
 t/align.t		Try unaligned memory blocks
 t/badfile.t             Try addfile() on unopened file
+t/bits.t		Try add_bits method
 t/clone.t		Try clone() method.
 t/files.t		Check a few files.
 t/md5-aaa.t		Exercise padding code

Modified: trunk/orca/packages/Digest-MD5-2.33/MD5.pm
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/MD5.pm	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/MD5.pm	Thu Jan 15 13:31:43 2004
@@ -3,7 +3,7 @@
 use strict;
 use vars qw($VERSION @ISA @EXPORT_OK);
 
-$VERSION = '2.30';  # $Date: 2003/10/09 09:26:59 $
+$VERSION = '2.33';  # $Date: 2003/12/07 08:40:18 $
 
 require Exporter;
 *import = \&Exporter::import;
@@ -13,6 +13,16 @@
 @ISA=qw(DynaLoader);
 
 eval {
+    require Digest::base;
+    push(@ISA, 'Digest::base');
+};
+if ($@) {
+    my $err = $@;
+    *add_bits = sub { die $err };
+}
+
+
+eval {
     Digest::MD5->bootstrap($VERSION);
 };
 if ($@) {
@@ -173,6 +183,16 @@
 In most cases you want to make sure that the $io_handle is in
 C<binmode> before you pass it as argument to the addfile() method.
 
+=item $md5->add_bits($data, $nbits)
+
+=item $md5->add_bits($bitstring)
+
+Since the MD5 algorithm is byte oriented you might only add bits as
+multiples of 8, so you probably want to just use add() instead.  The
+add_bits() method is provided for compatibility with other digest
+implementations.  See L<Digest> for description of the arguments
+that add_bits() take.
+
 =item $md5->digest
 
 Return the binary digest for the message.  The returned string will be

Modified: trunk/orca/packages/Digest-MD5-2.33/MD5.xs
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/MD5.xs	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/MD5.xs	Thu Jan 15 13:31:43 2004
@@ -1,4 +1,4 @@
-/* $Id: MD5.xs,v 1.40 2003/07/22 05:59:27 gisle Exp $ */
+/* $Id: MD5.xs,v 1.42 2003/12/06 22:35:16 gisle Exp $ */
 
 /* 
  * This library is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
+#define PERL_NO_GET_CONTEXT     /* we want efficiency */
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
@@ -83,6 +84,11 @@
    #define SvPVbyte SvPV
 #endif
 
+#ifndef dTHX
+   #define pTHX_
+   #define aTHX_
+#endif
+
 /* Perl does not guarantee that U32 is exactly 32 bits.  Some system
  * has no integral type with exactly 32 bits.  For instance, A Cray has
  * short, int and long all at 64 bits so we need to apply this macro
@@ -460,7 +466,7 @@
 #define INT2PTR(any,d)	(any)(d)
 #endif
 
-static MD5_CTX* get_md5_ctx(SV* sv)
+static MD5_CTX* get_md5_ctx(pTHX_ SV* sv)
 {
     if (SvROK(sv)) {
 	sv = SvRV(sv);
@@ -521,7 +527,7 @@
 #define F_HEX 1
 #define F_B64 2
 
-static SV* make_mortal_sv(const unsigned char *src, int type)
+static SV* make_mortal_sv(pTHX_ const unsigned char *src, int type)
 {
     STRLEN len;
     char result[33];
@@ -571,7 +577,7 @@
 	    sv_setref_pv(ST(0), sclass, (void*)context);
 	    SvREADONLY_on(SvRV(ST(0)));
 	} else {
-	    context = get_md5_ctx(xclass);
+	    context = get_md5_ctx(aTHX_ xclass);
 	}
         MD5Init(context);
 	XSRETURN(1);
@@ -580,7 +586,7 @@
 clone(self)
 	SV* self
     PREINIT:
-	MD5_CTX* cont = get_md5_ctx(self);
+	MD5_CTX* cont = get_md5_ctx(aTHX_ self);
 	char *myname = sv_reftype(SvRV(self),TRUE);
 	MD5_CTX* context;
     PPCODE:
@@ -602,7 +608,7 @@
 add(self, ...)
 	SV* self
     PREINIT:
-	MD5_CTX* context = get_md5_ctx(self);
+	MD5_CTX* context = get_md5_ctx(aTHX_ self);
 	int i;
 	unsigned char *data;
 	STRLEN len;
@@ -618,7 +624,7 @@
 	SV* self
 	InputStream fh
     PREINIT:
-	MD5_CTX* context = get_md5_ctx(self);
+	MD5_CTX* context = get_md5_ctx(aTHX_ self);
 	STRLEN fill = context->bytes_low & 0x3F;
 	unsigned char buffer[4096];
 	int  n;
@@ -662,7 +668,7 @@
     PPCODE:
         MD5Final(digeststr, context);
 	MD5Init(context);  /* In case it is reused */
-        ST(0) = make_mortal_sv(digeststr, ix);
+        ST(0) = make_mortal_sv(aTHX_ digeststr, ix);
         XSRETURN(1);
 
 void
@@ -709,5 +715,5 @@
 	    MD5Update(&ctx, data, len);
 	}
 	MD5Final(digeststr, &ctx);
-        ST(0) = make_mortal_sv(digeststr, ix);
+        ST(0) = make_mortal_sv(aTHX_ digeststr, ix);
         XSRETURN(1);

Modified: trunk/orca/packages/Digest-MD5-2.33/Makefile.PL
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/Makefile.PL	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/Makefile.PL	Thu Jan 15 13:31:43 2004
@@ -5,6 +5,8 @@
 use Config qw(%Config);
 use ExtUtils::MakeMaker;
 
+my $PERL_CORE = grep $_ eq "PERL_CORE=1", @ARGV;
+
 my @extra;
 @extra = (DEFINE => "-DU32_ALIGNMENT_REQUIRED") unless free_u32_alignment();
 
@@ -18,11 +20,14 @@
 }
 
 push(@extra, 'INSTALLDIRS'  => 'perl') if $] >= 5.008;
+push(@extra, 'MAN3PODS' => {}) if $PERL_CORE; # Pods built by installman.
 
 WriteMakefile(
     'NAME'	   => 'Digest::MD5',
     'VERSION_FROM' => 'MD5.pm',
-    'PREREQ_PM'    => { 'File::Spec' => 0 },
+    'PREREQ_PM'    => { 'File::Spec' => 0,
+			'Digest::base' => '1.00',
+		      },
     @extra,
     'dist'         => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
 );
@@ -32,10 +37,24 @@
 sub free_u32_alignment
 {
     $|=1;
+    if (exists $Config{d_u32align}) {
+       print "Perl's config says that U32 access must ";
+       print "not " unless $Config{d_u32align};
+       print "be aligned.\n";
+       return !$Config{d_u32align};
+    }
+    
+    if ($^O eq 'VMS' || $^O eq 'MSWin32') {
+       print "Assumes that $^O implies free alignment for U32 access.\n";
+       return 1;
+    }
+    
+    if ($^O eq 'hpux' && $Config{osvers} < 11.0) {
+       print "Will not test for free alignment on older HP-UX.\n";
+       return 0;
+    }
+    
     print "Testing alignment requirements for U32... ";
-    return 1 if $^O eq 'VMS';
-    return 1 if $^O eq 'MSWin32';
-
     open(ALIGN_TEST, ">u32align.c") or die "$!";
     print ALIGN_TEST <<'EOT'; close(ALIGN_TEST);
 /*--------------------------------------------------------------*/

Added: trunk/orca/packages/Digest-MD5-2.33/t/bits.t
==============================================================================
--- (empty file)
+++ trunk/orca/packages/Digest-MD5-2.33/t/bits.t	Thu Jan 15 13:31:43 2004
@@ -0,0 +1,26 @@
+#!perl -w
+
+use Test qw(plan ok);
+plan tests => 2;
+
+use Digest::MD5;
+
+my $md5 = Digest::MD5->new;
+
+if ($Digest::base::VERSION) {
+    $md5->add_bits("01111111");
+    ok($md5->hexdigest, "83acb6e67e50e31db6ed341dd2de1595");
+    eval {
+	$md5->add_bits("0111");
+    };
+    ok($@ =~ /must be multiple of 8/);
+}
+else {
+    print "# No Digest::base\n";
+    eval {
+	$md5->add_bits("foo");
+    };
+    ok($@ =~ /^Can\'t locate Digest\/base\.pm in \@INC/);
+    ok(1);  # dummy
+}
+

Modified: trunk/orca/packages/Digest-MD5-2.33/t/files.t
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/t/files.t	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/t/files.t	Thu Jan 15 13:31:43 2004
@@ -20,27 +20,27 @@
 my $EXPECT;
 if (ord "A" == 193) { # EBCDIC
     $EXPECT = <<EOT;
-e1d7df564fad76d2f0ed628c648d5833  Changes
+15e4c91ad67f5ff238033305376c9140  Changes
 0565ec21b15c0f23f4c51fb327c8926d  README
-4d48606863dbc7fd131c2e7b5eefc8c5  MD5.pm
-45e5e6785b47fb922f33b4a74c29a148  MD5.xs
+f0f77710cd8d5ba7d9faedec8d02dc2f  MD5.pm
+f9848c0ee3b20a9177465eec19361e6c  MD5.xs
 276da0aa4e9a08b7fe09430c9c5690aa  rfc1321.txt
 EOT
 } elsif ("\n" eq "\015") { # MacOS
     $EXPECT = <<EOT;
-c780484c87b64e32bd55c6be58b623b4  Changes
+dea016b088ab4d88a5e7cbd9c15a9c88  Changes
 6c950a0211a5a28f023bb482037698cd  README
-546c4e62999c9888d7d46732a21c9dff  MD5.pm
-ca3f8cb317c5d088ed9f97204c6b8cda  MD5.xs
+f057c88277ecee875cf6f0352468407a  MD5.pm
+5bae62404829e6fd8ad0d4f8d5ccea54  MD5.xs
 754b9db19f79dbc4992f7166eb0f37ce  rfc1321.txt
 EOT
 } else {
     # This is the output of: 'md5sum Changes README MD5.pm MD5.xs rfc1321.txt'
     $EXPECT = <<EOT;
-2bdd59aa1e816cd8df05968e70f75cf1  Changes
+0f09886e2c129bdabf57674c6822bd4f  Changes
 6c950a0211a5a28f023bb482037698cd  README
-546c4e62999c9888d7d46732a21c9dff  MD5.pm
-ca3f8cb317c5d088ed9f97204c6b8cda  MD5.xs
+f057c88277ecee875cf6f0352468407a  MD5.pm
+5bae62404829e6fd8ad0d4f8d5ccea54  MD5.xs
 754b9db19f79dbc4992f7166eb0f37ce  rfc1321.txt
 EOT
 }

Modified: trunk/orca/packages/Digest-MD5-2.33/typemap
==============================================================================
--- trunk/orca/packages/Digest-MD5-2.30/typemap	(original)
+++ trunk/orca/packages/Digest-MD5-2.33/typemap	Thu Jan 15 13:31:43 2004
@@ -2,4 +2,4 @@
 
 INPUT
 T_MD5_CTX
-	$var = get_md5_ctx($arg)
+	$var = get_md5_ctx(aTHX_ $arg)



More information about the Orca-checkins mailing list