Index: files/patch-lib_ssl_c_src_Makefile.in
===================================================================
--- files/patch-lib_ssl_c_src_Makefile.in	(revision 41521)
+++ files/patch-lib_ssl_c_src_Makefile.in	(working copy)
@@ -1,6 +1,6 @@
---- lib/ssl/c_src/Makefile.in.orig	2008-04-13 20:41:08.000000000 -0700
-+++ lib/ssl/c_src/Makefile.in	2008-04-13 20:38:18.000000000 -0700
-@@ -38,7 +38,7 @@
+--- lib/ssl/c_src/Makefile.in.orig	2008-11-04 12:17:23.000000000 +0100
++++ lib/ssl/c_src/Makefile.in	2008-11-06 07:46:48.000000000 +0100
+@@ -40,7 +40,7 @@
  CC = @CC@
  LD = @LD@
  SHELL = /bin/sh
@@ -9,7 +9,7 @@
  PLAIN_CFLAGS = @CFLAGS@
  
  # ----------------------------------------------------
-@@ -124,7 +124,7 @@
+@@ -126,7 +126,7 @@
  CC_R_OPT = $(CC_R_FLAG)$(SSL_LIBDIR)
  endif
  
Index: files/patch-decode_fun.c.diff
===================================================================
--- files/patch-decode_fun.c.diff	(revision 0)
+++ files/patch-decode_fun.c.diff	(revision 0)
@@ -0,0 +1,11 @@
+--- lib/erl_interface/src/decode/decode_fun.c.orig	2008-11-06 06:53:46.000000000 +0100
++++ lib/erl_interface/src/decode/decode_fun.c	2008-11-06 06:54:09.000000000 +0100
+@@ -103,7 +103,7 @@
+ 		memcpy(p->free_vars, s, n);
+ 	    }
+ 	}
+-	*index += s-s0;
++	*index += n + s-s0;
+         return 0;
+ 	break;
+     default:
Index: files/patch-erts_emulator_sys_unix_ddll.c
===================================================================
--- files/patch-erts_emulator_sys_unix_ddll.c	(revision 41521)
+++ files/patch-erts_emulator_sys_unix_ddll.c	(working copy)
@@ -1,27 +0,0 @@
---- erts/emulator/sys/unix/erl_unix_sys_ddll.c	2007-11-26 20:01:23.000000000 +0100
-+++ erts/emulator/sys/unix/erl_unix_sys_ddll.c	2008-09-07 10:13:54.000000000 +0200
-@@ -127,6 +127,7 @@
- 	    } else {
- 		ret = ERL_DE_ERROR_UNSPECIFIED;
- 	    }
-+		NSDestroyObjectFileImage(ofile);
- 	    break;
- 	/* XXX:PaN should anything return something else ? */
- 	/*case NSObjectFileImageInappropriateFile:
-@@ -240,7 +241,15 @@
- int erts_sys_ddll_close(void *handle)
- {
- #if defined(HAVE_MACH_O_DYLD_H)
--    return ERL_DE_NO_ERROR; /* XXX:PaN No close functionality in MacOSX??? */
-+    {
-+	int ret;
-+	if (NSUnLinkModule((NSModule) handle, NSUNLINKMODULE_OPTION_NONE)) {
-+	    ret = ERL_DE_NO_ERROR;
-+	} else {
-+	    ret = ERL_DE_ERROR_UNSPECIFIED;
-+	}
-+	return ret;
-+    }
- #elif defined(HAVE_DLOPEN)
-     {
- 	int ret;
Index: files/patch-lib_ssl_c_src_esock_openssl.c
===================================================================
--- files/patch-lib_ssl_c_src_esock_openssl.c	(revision 41521)
+++ files/patch-lib_ssl_c_src_esock_openssl.c	(working copy)
@@ -1,6 +1,6 @@
---- lib/ssl/c_src/esock_openssl.c.orig	2008-03-12 22:15:41.000000000 -0700
-+++ lib/ssl/c_src/esock_openssl.c	2008-03-12 22:16:01.000000000 -0700
-@@ -905,8 +905,8 @@
+--- lib/ssl/c_src/esock_openssl.c.orig	2008-11-04 12:17:23.000000000 +0100
++++ lib/ssl/c_src/esock_openssl.c	2008-11-06 07:46:48.000000000 +0100
+@@ -907,8 +907,8 @@
      }
  
      /* info callback */
Index: files/patch-eunit_xml.diff
===================================================================
--- files/patch-eunit_xml.diff	(revision 41521)
+++ files/patch-eunit_xml.diff	(working copy)
@@ -1,7 +1,7 @@
-Index: src/eunit_xml.erl
+Index: lib/eunit/src/eunit_xml.erl
 ===================================================================
---- src/eunit_xml.erl	(revision 0)
-+++ src/eunit_xml.erl	(revision 0)
+--- lib/eunit/src/eunit_xml.erl	(revision 0)
++++ lib/eunit/src/eunit_xml.erl	(revision 0)
 @@ -0,0 +1,496 @@
 +%% This library is free software; you can redistribute it and/or modify
 +%% it under the terms of the GNU Lesser General Public License as
@@ -499,20 +499,20 @@
 +    ].
 +
 +-endif.  % TEST
-Index: src/eunit.erl
+Index: lib/eunit/src/eunit.erl
 ===================================================================
---- src/eunit.erl	(revision 249)
-+++ src/eunit.erl	(working copy)
-@@ -113,7 +113,7 @@
-     try eunit_data:list(T) of
+--- lib/eunit/src/eunit.erl.orig	2008-11-04 11:52:12.000000000 +0100
++++ lib/eunit/src/eunit.erl	2008-11-06 07:24:28.000000000 +0100
+@@ -148,7 +148,7 @@
+     try eunit_data:list(Tests) of
  	List ->
  	    Listeners = [eunit_tty:start(List, Options)
 -			 | listeners(Options)],
 +			 | listeners(List, Options)],
  	    Serial = eunit_serial:start(Listeners),
- 	    case eunit_server:start_test(Server, Serial, T, Options) of
+ 	    case eunit_server:start_test(Server, Serial, Tests, Options) of
  		{ok, Reference} -> test_run(Reference, Listeners);
-@@ -159,10 +159,12 @@
+@@ -197,10 +197,12 @@
      Dummy = spawn(fun devnull/0),
      eunit_server:start_test(Server, Dummy, T, Options).
  
@@ -526,15 +526,17 @@
  	LogFile ->
  	    [spawn(fun () -> event_logger(LogFile) end)]
      end.
-Index: src/Makefile
+Index: lib/eunit/src/Makefile
 ===================================================================
---- src/Makefile	(revision 249)
-+++ src/Makefile	(working copy)
-@@ -22,6 +22,7 @@
+--- lib/eunit/src/Makefile.orig	2008-11-04 11:52:12.000000000 +0100
++++ lib/eunit/src/Makefile	2008-11-06 07:23:09.000000000 +0100
+@@ -37,7 +37,8 @@
+ 	eunit_test.erl \
  	eunit_lib.erl \
  	eunit_data.erl \
- 	eunit_tty.erl \
-+	eunit_xml.erl \
- 	code_monitor.erl \
- 	file_monitor.erl \
- 	autoload.erl
+-	eunit_tty.erl
++	eunit_tty.erl \
++	eunit_xml.erl
+ 
+ OBJECTS=$(SOURCES:%.erl=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET)
+ 

Property changes on: files/patch-eunit_xml.diff
___________________________________________________________________
Added: svn:mergeinfo

Index: files/patch-decode_big.c.diff
===================================================================
--- files/patch-decode_big.c.diff	(revision 0)
+++ files/patch-decode_big.c.diff	(revision 0)
@@ -0,0 +1,13 @@
+--- lib/erl_interface/src/decode/decode_big.c.orig	2008-11-06 06:57:02.000000000 +0100
++++ lib/erl_interface/src/decode/decode_big.c	2008-11-06 06:58:39.000000000 +0100
+@@ -51,7 +51,9 @@
+       u = (unsigned char *) s;
+       for (i = 0; i < b->arity; ++i) {
+ 	  dt[i] = u[i*2];
+-	  dt[i] |= ((unsigned short) u[(i*2)+1]) << 8;
++        if ((i*2 + 1) < digit_bytes) {
++          dt[i] |= ((unsigned short) u[(i*2)+1]) << 8;
++        }
+       }
+   } else {
+       s++; /* skip sign byte */
Index: Portfile
===================================================================
--- Portfile	(revision 41521)
+++ Portfile	(working copy)
@@ -2,8 +2,7 @@
 
 PortSystem 1.0
 name		erlang
-version		R12B-4
-revision    1
+version		R12B-5
 categories	lang erlang
 maintainers	bfulgham@macports.org
 platforms	darwin
@@ -32,29 +31,34 @@
 		otp_doc_man_${version}${extract.suffix}		\
 		otp_doc_html_${version}${extract.suffix}
 
-checksums       otp_src_R12B-4.tar.gz \
-                    md5     ae81edda4a17506af7a9d73abca033b2 \
-                    sha1    4e42454c3f560ce6efd3c917a79a5b288664e329 \
-                    rmd160  3c57ae04388c0493d97c76529c57c50de639bdce \
-                otp_doc_man_R12B-4.tar.gz \
-                    md5     ef8f96d1721a2345cc87b208cde3de06 \
-                    sha1    b954711b493e384606ce23d32a6d980017637b10 \
-                    rmd160  f14eb1f542ebecceddd6ac70aa4ed325f91b0b24 \
-                otp_doc_html_R12B-4.tar.gz \
-                    md5     f633cd418d8260af7a11c998aa88072b \
-                    sha1    cbe6bc52a5000b21de5cac5f9b2672b935e94ed7 \
-                    rmd160  bf05981ddf2e97910141739980cee09572b1c34d
+checksums       otp_src_R12B-5.tar.gz \
+                    md5     250fc48242a098073474e563c3f23e76 \
+                    sha1    681570df942cd53d2c18404b356dd5dc1ff016ef \
+                    rmd160  7473d6119a55365ebe582c55c8b19c3f2870565a \
+                otp_doc_man_R12B-5.tar.gz \
+                    md5     6231cb172847040395cc34b20781aa3b \
+                    sha1    ae7036bd2afc9d1fca97f0de2eca84f56656def8 \
+                    rmd160  e28d555d0a86fc69e0ee091864828c8eaa58d2be \
+                otp_doc_html_R12B-5.tar.gz \
+                    md5     fb0c5454bbd865e881b6712295f6d41f \
+                    sha1    0bd369d02051e01bac58c9b8665bd3538e116f51 \
+                    rmd160  b460906043171b27735332ec90c45e38d888869a
 
 extract.only	otp_src_${version}${extract.suffix}
 
 pre-patch	{ file rename ${workpath}/otp_src_${version} ${workpath}/${name}-${version} }
 
+# http://www.erlang.org/pipermail/erlang-bugs/2008-October/001023.html
+# http://www.erlang.org/pipermail/erlang-bugs/2008-October/001024.html
+# http://support.process-one.net/browse/EUNIT-13
 patchfiles	patch-toolbar.erl \
                 patch-erts_emulator_Makefile.in \
                 patch-lib_ssl_c_src_esock_openssl.c \
                 patch-lib_ssl_c_src_Makefile.dist \
                 patch-lib_ssl_c_src_Makefile.in \
-                patch-erts_emulator_sys_unix_ddll.c
+                patch-decode_big.c.diff \
+                patch-decode_fun.c.diff \
+                patch-eunit_xml.diff
 
 configure.args  --prefix=${destroot}${prefix}	\
                 --enable-kernel-poll            \
@@ -94,7 +98,7 @@
 	system "tar -C ${destroot}${prefix}/lib/erlang -zxvf ${distpath}/otp_doc_html_${version}${extract.suffix}"
 	system "tar -C ${destroot}${prefix}/lib/erlang -zxvf ${distpath}/otp_doc_man_${version}${extract.suffix}"
  
-        set erts_dir   erts-5.6.4
+        set erts_dir   erts-5.6.5
 
         reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/bin/erl
         reinplace s|${destroot}|| ${destroot}${prefix}/lib/erlang/bin/start
@@ -106,4 +110,9 @@
 
 	file delete -force ${destroot}${prefix}/lib/erlang/bin/epmd
 	system "ln -s ../${erts_dir}/bin/epmd ${destroot}${prefix}/lib/erlang/bin/epmd"
+
+    # Fix eunit.
+    # See http://www.erlang.org/pipermail/erlang-questions/2008-November/039625.html
+    file mkdir ${destroot}${prefix}/lib/erlang/lib/eunit-2.0/include/
+	file copy ${worksrcpath}/lib/eunit/include/eunit.hrl ${destroot}${prefix}/lib/erlang/lib/eunit-2.0/include/
 }
